fix: handle missing Supabase environment variables in middleware and … #9
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Web Deploy | ||
|
Check failure on line 1 in .github/workflows/web-deploy.yml
|
||
| on: | ||
| push: | ||
| branches: [main, master] | ||
| paths: | ||
| - 'apps/web/**' | ||
| - 'packages/**' | ||
| - 'pnpm-lock.yaml' | ||
| release: | ||
| types: [published] | ||
| workflow_dispatch: | ||
| jobs: | ||
| deploy: | ||
| name: Deploy to Railway/Vercel | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| - name: Setup pnpm | ||
| uses: pnpm/action-setup@v4 | ||
| with: | ||
| version: 9 | ||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 24 | ||
| cache: 'pnpm' | ||
| - name: Install dependencies | ||
| run: pnpm install --frozen-lockfile | ||
| - name: Build shared packages | ||
| run: pnpm --filter @pairux/shared-types build | ||
| - name: Build web app | ||
| run: pnpm --filter @pairux/web build | ||
| env: | ||
| NEXT_PUBLIC_SUPABASE_URL: ${{ secrets.NEXT_PUBLIC_SUPABASE_URL }} | ||
| NEXT_PUBLIC_SUPABASE_ANON_KEY: ${{ secrets.NEXT_PUBLIC_SUPABASE_ANON_KEY }} | ||
| NEXT_PUBLIC_APP_URL: ${{ secrets.NEXT_PUBLIC_APP_URL || 'https://pairux.com' }} | ||
| # Vercel deployment (if VERCEL_TOKEN is set) | ||
| - name: Deploy to Vercel | ||
| if: ${{ secrets.VERCEL_TOKEN != '' }} | ||
| uses: amondnet/vercel-action@v25 | ||
| with: | ||
| vercel-token: ${{ secrets.VERCEL_TOKEN }} | ||
| vercel-org-id: ${{ secrets.VERCEL_ORG_ID }} | ||
| vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }} | ||
| working-directory: apps/web | ||
| vercel-args: ${{ github.event_name == 'release' && '--prod' || '' }} | ||
| # Railway deployment (if RAILWAY_TOKEN is set) - uses railway.toml config | ||
| - name: Deploy to Railway | ||
| if: ${{ secrets.RAILWAY_TOKEN != '' && secrets.VERCEL_TOKEN == '' }} | ||
| run: | | ||
| npm install -g @railway/cli | ||
| cd apps/web | ||
| railway up --detach | ||
| env: | ||
| RAILWAY_TOKEN: ${{ secrets.RAILWAY_TOKEN }} | ||
| # Build artifact for manual deployment | ||
| build-artifact: | ||
| name: Build Artifact | ||
| runs-on: ubuntu-latest | ||
| if: github.event_name == 'workflow_dispatch' | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| - name: Setup pnpm | ||
| uses: pnpm/action-setup@v4 | ||
| with: | ||
| version: 9 | ||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 24 | ||
| cache: 'pnpm' | ||
| - name: Install dependencies | ||
| run: pnpm install --frozen-lockfile | ||
| - name: Build | ||
| run: pnpm --filter @pairux/web build | ||
| env: | ||
| NEXT_PUBLIC_SUPABASE_URL: ${{ secrets.NEXT_PUBLIC_SUPABASE_URL || 'https://placeholder.supabase.co' }} | ||
| NEXT_PUBLIC_SUPABASE_ANON_KEY: ${{ secrets.NEXT_PUBLIC_SUPABASE_ANON_KEY || 'placeholder-key' }} | ||
| - name: Upload artifact | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: web-dist | ||
| path: apps/web/.next | ||
| retention-days: 30 | ||