fix(rate-limits): validate admin rule updates #210
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 QR Production Deployment | |
| on: | |
| push: | |
| branches: | |
| - production | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| check-ci: | |
| uses: ./.github/workflows/ci-check.yml | |
| with: | |
| workflow_name: vercel-production-qr.yaml | |
| permissions: | |
| contents: read | |
| deployments: read | |
| Deploy-Production: | |
| needs: [check-ci] | |
| if: github.ref == 'refs/heads/production' && needs.check-ci.outputs.should_run == 'true' | |
| environment: vercel-production-qr | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| deployments: write | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 2 | |
| - name: Check for newer commits | |
| id: check_commits | |
| run: | | |
| git fetch origin production || { echo "Remote branch not found, continuing with build"; echo "skip_build=false" >> $GITHUB_OUTPUT; exit 0; } | |
| LATEST_COMMIT=$(git rev-parse origin/production 2>/dev/null || echo "") | |
| CURRENT_COMMIT=${GITHUB_SHA} | |
| if [ -n "$LATEST_COMMIT" ] && [ "$LATEST_COMMIT" != "$CURRENT_COMMIT" ]; then | |
| echo "Newer commit found on production branch. Skipping build." | |
| echo "skip_build=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "This is the latest commit. Proceeding with build." | |
| echo "skip_build=false" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Setup bun | |
| if: steps.check_commits.outputs.skip_build != 'true' | |
| uses: ./.github/actions/setup-bun-with-retry | |
| with: | |
| bun-version: 1.3.14 | |
| - name: Use Node.js 24 | |
| if: steps.check_commits.outputs.skip_build != 'true' | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| - name: Install dependencies | |
| if: steps.check_commits.outputs.skip_build != 'true' | |
| run: bash scripts/ci/run-with-backoff.sh bun install | |
| - name: Install Vercel CLI | |
| if: steps.check_commits.outputs.skip_build != 'true' | |
| run: bash scripts/ci/run-with-backoff.sh bun install --global vercel@latest | |
| - name: Pull Vercel Environment Information | |
| if: steps.check_commits.outputs.skip_build != 'true' | |
| env: | |
| VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} | |
| VERCEL_PROJECT_ID: ${{ secrets.VERCEL_QR_PROJECT_ID }} | |
| run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }} | |
| - name: Build workspace dependencies | |
| if: steps.check_commits.outputs.skip_build != 'true' | |
| run: bun turbo:local run build --filter=@tuturuuu/types --filter=@tuturuuu/supabase --filter=@tuturuuu/internal-api | |
| - name: Generate shared build metadata | |
| if: steps.check_commits.outputs.skip_build != 'true' | |
| run: bun run --silent scripts/ci/generate-build-metadata.ts | |
| - name: Build Project Artifacts | |
| if: steps.check_commits.outputs.skip_build != 'true' | |
| env: | |
| VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} | |
| VERCEL_PROJECT_ID: ${{ secrets.VERCEL_QR_PROJECT_ID }} | |
| run: vercel build --prod --token=${{ secrets.VERCEL_TOKEN }} | |
| - name: Deploy Project Artifacts to Vercel | |
| if: steps.check_commits.outputs.skip_build != 'true' | |
| env: | |
| VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} | |
| VERCEL_PROJECT_ID: ${{ secrets.VERCEL_QR_PROJECT_ID }} | |
| run: vercel deploy --archive=tgz --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }} | |
| - name: Record successful Vercel deployment marker | |
| if: steps.check_commits.outputs.skip_build != 'true' | |
| continue-on-error: true | |
| env: | |
| GITHUB_TOKEN: ${{ github.token }} | |
| VERCEL_WORKFLOW_NAME: vercel-production-qr.yaml | |
| run: bun run --silent scripts/ci/record-vercel-deployment.ts |