Skip to content

Merge pull request #1004 from ChainBench/dev #646

Merge pull request #1004 from ChainBench/dev

Merge pull request #1004 from ChainBench/dev #646

name: Vercel staging deploy
on:
push:
branches:
- dev
workflow_dispatch:
concurrency:
group: vercel-staging
cancel-in-progress: true
jobs:
deploy:
runs-on: ubuntu-latest
# 30 min: the build prerenders every bench/product/OG route against
# Prom through a query concurrency cap, and the per-page budget is
# 240s (next.config.ts). 15 min started killing builds once the HL
# bench grew past 60 providers.
timeout-minutes: 30
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 24
- name: Enable pnpm via corepack
run: |
corepack enable
corepack prepare pnpm@10 --activate
pnpm --version
- name: Install Vercel CLI
run: npm install -g vercel@latest
- name: Pull Vercel env (Preview)
run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }}
- name: Build
run: vercel build --token=${{ secrets.VERCEL_TOKEN }}
- name: Deploy Preview
id: deploy
run: |
# --archive=tgz uploads ONE tarball instead of thousands of
# files: the team's api-upload-paid quota (40k reqs / rolling
# 24h) was exhausted twice on busy merge days (2026-07-06/07),
# blocking every deploy for hours.
url=$(vercel deploy --prebuilt --archive=tgz --token=${{ secrets.VERCEL_TOKEN }})
echo "url=$url" >> "$GITHUB_OUTPUT"
echo "Preview ready at $url"
- name: Update stable staging alias
run: |
vercel alias set "${{ steps.deploy.outputs.url }}" \
staging-openchainbench.vercel.app \
--token=${{ secrets.VERCEL_TOKEN }} \
--scope=${{ secrets.VERCEL_ORG_ID }}
# Each deployment starts with an empty ISR cache; until the
# materialize worker's next sweep (≤5 min) every page hit is a
# cold render. Warming here closes that window so a deploy never
# ships a slow first impression.
- name: Warm bench pages
run: |
base="https://staging-openchainbench.vercel.app"
curl -sf --max-time 30 "$base/sitemap.xml" \
| grep -o 'https://[^<]*/benchmarks/[a-z0-9-]*' \
| sed "s|https://[^/]*|$base|" | sort -u \
| xargs -P 4 -I{} curl -s -o /dev/null -w "%{http_code} %{time_total}s {}\n" --max-time 120 {} \
|| echo "warm-up failed (non-blocking)"
- name: Comment summary
run: |
{
echo "## Vercel staging deploy ✓"
echo ""
echo "**Stable:** https://staging-openchainbench.vercel.app"
echo ""
echo "**Preview:** ${{ steps.deploy.outputs.url }}"
echo ""
echo "Commit: \`${{ github.sha }}\`"
} >> "$GITHUB_STEP_SUMMARY"