Skip to content

vercel.deployment.ready #48

vercel.deployment.ready

vercel.deployment.ready #48

name: Vercel Deployment Checks
on:
repository_dispatch:
types: [vercel.deployment.ready]
workflow_dispatch:
permissions:
actions: read
contents: read
statuses: write
jobs:
production-ready:
if: |
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'repository_dispatch' &&
(github.event.client_payload.environment == 'production' ||
github.event.client_payload.target == 'production'))
runs-on: ubuntu-latest
environment: production
env:
NEXT_PUBLIC_CONVEX_URL: ${{ vars.NEXT_PUBLIC_CONVEX_URL || secrets.NEXT_PUBLIC_CONVEX_URL }}
CONVEX_SITE_URL: ${{ vars.CONVEX_SITE_URL || secrets.CONVEX_SITE_URL }}
ANALYZE_API_KEY: ${{ vars.ANALYZE_API_KEY || secrets.ANALYZE_API_KEY }}
steps:
- name: Checkout repository
uses: vercel/repository-dispatch/actions/checkout@v1
- name: Install pnpm
uses: pnpm/action-setup@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'pnpm'
cache-dependency-path: pnpm-lock.yaml
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Fetch main branch for changed-file checks
run: git fetch --no-tags --depth=1 origin main
- name: Check centralized constants
run: pnpm check:constants
- name: Check no new magic numbers on changed files
run: pnpm check:no-magic-changed
- name: Lint
run: pnpm lint
- name: Test
run: pnpm test
- name: Restore Next.js build cache
uses: actions/cache@v4
with:
path: apps/web/.next/cache
key: ${{ runner.os }}-nextjs-${{ hashFiles('pnpm-lock.yaml') }}-${{ hashFiles('package.json', 'pnpm-workspace.yaml', 'turbo.json', 'packages/*/package.json', 'packages/*/src/**', 'apps/web/app/**', 'apps/web/components/**', 'apps/web/convex/**', 'apps/web/data/**', 'apps/web/lib/**', 'apps/web/public/**', 'apps/web/styles/**', 'apps/web/*.json', 'apps/web/*.mjs', 'apps/web/*.ts', 'apps/web/*.tsx') }}
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('pnpm-lock.yaml') }}-
${{ runner.os }}-nextjs-
- name: Build
run: pnpm build
- name: notify vercel
if: always() && github.event_name == 'repository_dispatch'
uses: vercel/repository-dispatch/actions/status@v1
with:
name: "Vercel - stackmatch: production-ready"