Skip to content

Merge pull request #608 from webstackdev/bugfix/vercel-500-error #57

Merge pull request #608 from webstackdev/bugfix/vercel-500-error

Merge pull request #608 from webstackdev/bugfix/vercel-500-error #57

name: Deploy Production
on:
push:
branches:
- main
workflow_dispatch:
permissions:
actions: read
contents: read
deployments: write
issues: write
pull-requests: write
jobs:
deploy-production:
name: Deploy Production
runs-on: ubuntu-latest
environment: production
env:
PUBLIC_GOOGLE_MAPS_API_KEY: ${{ vars.PUBLIC_GOOGLE_MAPS_API_KEY }}
PUBLIC_GOOGLE_MAP_ID: ${{ vars.PUBLIC_GOOGLE_MAP_ID }}
PUBLIC_SENTRY_DSN: ${{ vars.PUBLIC_SENTRY_DSN }}
PUBLIC_UPSTASH_SEARCH_REST_URL: ${{ vars.PUBLIC_UPSTASH_SEARCH_REST_URL }}
PUBLIC_UPSTASH_SEARCH_READONLY_TOKEN: ${{ vars.PUBLIC_UPSTASH_SEARCH_READONLY_TOKEN }}
VERCEL_ORG_ID: ${{ vars.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ vars.VERCEL_PROJECT_ID }}
permissions:
actions: read
contents: read
deployments: write
issues: write
pull-requests: write
steps:
- name: Checkout repository
uses: actions/checkout@v6.0.2
- name: Setup Node
uses: actions/setup-node@v6.3.0
with:
node-version-file: .nvmrc
cache: npm
- name: Install dependencies
run: npm ci --force
- name: Install Playwright Chromium (with system deps)
run: npx playwright install --with-deps chromium
- name: Install Vercel CLI
run: npm install --global vercel@latest
- name: Vercel pull (production)
env:
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
run: vercel pull --yes --environment=production --token=${VERCEL_TOKEN}
- name: Vercel build (production)
env:
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
NODE_ENV: production
run: vercel build --prod --token=${VERCEL_TOKEN}
##
# This requires Playwright to succeed when triggering e2e tests from a merge_group
# event. This allows moving long-running jobs into a slot in the total workflow where
# they don't run on every push to a pull request, but are still required to deploy
# to production and merge to main. Merge groups are only available in organization
# repos so disabled for now.
##
#- name: Require Playwright success
# if: github.event_name == 'push'
# uses: ./.github/actions/require-playwright-success
# with:
# github_token: ${{ github.token }}
# expected_sha: ${{ github.sha }}
# workflow_file: playwright.yml
- name: Deploy to Vercel (production)
uses: ./.github/actions/deploy-to-vercel-action
with:
GITHUB_TOKEN: ${{ github.token }}
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
VERCEL_ORG_ID: ${{ vars.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ vars.VERCEL_PROJECT_ID }}
PRODUCTION: true
PUBLIC_GOOGLE_MAPS_API_KEY: ${{ vars.PUBLIC_GOOGLE_MAPS_API_KEY }}
PUBLIC_GOOGLE_MAP_ID: ${{ vars.PUBLIC_GOOGLE_MAP_ID }}
PUBLIC_SENTRY_DSN: ${{ vars.PUBLIC_SENTRY_DSN }}
PUBLIC_UPSTASH_SEARCH_REST_URL: ${{ vars.PUBLIC_UPSTASH_SEARCH_REST_URL }}
PUBLIC_UPSTASH_SEARCH_READONLY_TOKEN: ${{ vars.PUBLIC_UPSTASH_SEARCH_READONLY_TOKEN }}
GITHUB_DEPLOYMENT_ENV: Production