Skip to content
Merged

wip #20

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions .github/workflows/build-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@ name: Build Reusable Steps
on:
workflow_call:
outputs:
build_output:
build_output: # Changed from build-output to build_output for consistency
description: "Build output artifact"
value: ${{ jobs.build.outputs.build_output }}
jobs:
build:
name: "Build Application"
runs-on: ubuntu-latest

outputs:
build_output: ${{ steps.build_step.outputs.result }}

Expand All @@ -29,7 +28,7 @@ jobs:
version: 8
run_install: false

- name: Get pnpm store directory
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
Expand All @@ -43,7 +42,6 @@ jobs:
restore-keys: |
${{ runner.os }}-pnpm-store-

# Install dependencies with fallback logic
- name: Install dependencies
run: |
# Attempt to install with --frozen-lockfile first
Expand All @@ -57,13 +55,12 @@ jobs:
pnpm install
fi

# Set up environment variables from GitHub secrets
- name: Set up environment variables
run: |
# Create .env file
touch .env

# Add Convex specific variables
# Add Convex specific variables
echo "NEXT_PUBLIC_CONVEX_URL=${{ secrets.NEXT_PUBLIC_CONVEX_URL }}" >> .env
echo "CONVEX_DEPLOYMENT=${{ secrets.CONVEX_DEPLOYMENT }}" >> .env

Expand All @@ -75,11 +72,13 @@ jobs:
echo "LIVE_BLOCK_SECRET_API_KEY=${{secrets.LIVE_BLOCK_SECRET_API_KEY}}" >> .env

- name: Build
run: pnpm build
id: build_step # Added this ID which is referenced in the outputs
run: |
pnpm build
echo "result=success" >> $GITHUB_OUTPUT
env:
NEXT_PUBLIC_CONVEX_URL: ${{ secrets.NEXT_PUBLIC_CONVEX_URL }}

# Upload the build artifacts to be used by the deploy job
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
Expand All @@ -90,4 +89,4 @@ jobs:
package.json
pnpm-lock.yaml
next.config.js
.env
.env
3 changes: 2 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ on:
branches: [main]
jobs:
build:
if: github.event.pull_request.merged == true
name: Build Application
uses: ./build-reusable.yml
uses: ./.github/workflows/build-reusable.yml
4 changes: 2 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ on:
jobs:
build:
name: Build Application
uses: ./build-reusable.yml
uses: ./.github/workflows/build-reusable.yml

deploy:
name: Deploy Application to Vercel
runs-on: ubuntu-latest
needs: call-build-steps
needs: build
environment: production
steps:
- name: Checkout Code
Expand Down
Loading