Merge pull request #409 from auth0/feat/github-registry-hybrid #229
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: Vercel Production Deployment | |
| env: | |
| VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} | |
| VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - production | |
| workflow_dispatch: | |
| jobs: | |
| Deploy-Production: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout the Codebase | |
| uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@36de12bed180fa130ed56a35e7344f2fa7a820ab # v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4 | |
| with: | |
| node-version: '22' | |
| cache: 'pnpm' | |
| - name: Install dependencies | |
| run: pnpm install --no-frozen-lockfile | |
| - name: Build all packages | |
| run: pnpm build | |
| - name: Install Vercel CLI | |
| run: npm install --global vercel@50.40.0 | |
| - name: Stage deployment artifacts | |
| run: | | |
| mkdir -p /tmp/static-deploy/dist | |
| # Copy the built static files into dist/ (matches outputDirectory in vercel.json) | |
| cp -r docs-site/dist/* /tmp/static-deploy/dist/ | |
| # Copy the API serverless functions to root api/ (Vercel convention) | |
| cp -r docs-site/api /tmp/static-deploy/ | |
| # Copy package.json so Vercel can install deps for the API function | |
| cp docs-site/package.json /tmp/static-deploy/package.json | |
| # Use the docs-site vercel.json (outputDirectory: dist, rewrites, no build needed) | |
| cp docs-site/vercel.json /tmp/static-deploy/vercel.json | |
| echo "Staged deployment contents:" | |
| ls -la /tmp/static-deploy/ | |
| ls -la /tmp/static-deploy/api/ | |
| ls -la /tmp/static-deploy/dist/ | head -20 | |
| - name: Deploy to Vercel (Production) | |
| id: deploy | |
| env: | |
| VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }} | |
| run: | | |
| vercel --version | |
| vercel deploy /tmp/static-deploy --prod --token="$VERCEL_TOKEN" --yes --scope="$VERCEL_ORG_ID" |