Skip to content

Commit 8a0d4e5

Browse files
OAGrclaude
authored andcommitted
fix: replace hourly scheduled deploy with per-push deploy on production
Remove scheduled-deploy.yml (hourly cron) and add a deploy job directly in ci.yml that fires after CI passes on pushes to the production branch. Fixes a silent bug where the hourly hook was likely configured for branch 'main', causing Vercel's ignoreCommand to cancel every build (it only allows 'production' builds). The new setup deploys immediately when a release PR merges, with no unnecessary hourly overhead. Also update vercel.json note to reflect the new flow. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 93bfb3e commit 8a0d4e5

File tree

3 files changed

+33
-77
lines changed

3 files changed

+33
-77
lines changed

.github/workflows/ci.yml

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -331,8 +331,35 @@ jobs:
331331
332332
gh issue create --title "$TITLE" --body "$BODY" --label "bug,groundskeeper-autofix"
333333
334-
# Deploy job removed — production deploys are now handled by the scheduled
335-
# deploy hook (scheduled-deploy.yml, every hour) instead of per-push.
336-
# This caps Vercel build minutes at 24/day max vs 50-80/day previously.
337-
# vercel.json sets github.enabled=false to prevent Vercel from posting
338-
# PR failure statuses (deploy hooks bypass the GitHub integration).
334+
deploy:
335+
# Trigger Vercel production deployment after CI passes on the production branch.
336+
# Vercel GitHub integration is disabled (vercel.json github.enabled=false) to
337+
# prevent PR failure statuses — deploy hooks bypass the GitHub integration.
338+
# The VERCEL_DEPLOY_HOOK_URL secret must be a hook configured for the "production" branch.
339+
needs: [ci]
340+
if: github.ref == 'refs/heads/production' && github.event_name == 'push'
341+
runs-on: ubuntu-latest
342+
timeout-minutes: 10
343+
344+
steps:
345+
- name: Trigger Vercel production deployment
346+
run: |
347+
if [ -z "${{ secrets.VERCEL_DEPLOY_HOOK_URL }}" ]; then
348+
echo "::error::VERCEL_DEPLOY_HOOK_URL secret is not set."
349+
echo "Go to Vercel Dashboard → Project → Settings → Git → Deploy Hooks"
350+
echo "Create a hook for Branch 'production', then add the URL as a GitHub secret."
351+
exit 1
352+
fi
353+
354+
RESPONSE=$(curl -s -o /tmp/vercel_response.json -w "%{http_code}" \
355+
-X POST "${{ secrets.VERCEL_DEPLOY_HOOK_URL }}")
356+
357+
echo "HTTP status: $RESPONSE"
358+
cat /tmp/vercel_response.json
359+
360+
if [ "$RESPONSE" -ge 200 ] && [ "$RESPONSE" -lt 300 ]; then
361+
echo "Production deployment triggered."
362+
else
363+
echo "::error::Vercel deploy hook returned HTTP $RESPONSE"
364+
exit 1
365+
fi

.github/workflows/scheduled-deploy.yml

Lines changed: 0 additions & 71 deletions
This file was deleted.

apps/web/vercel.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"framework": "nextjs",
44
"installCommand": "cd .. && npx pnpm@9 install",
55
"buildCommand": "node scripts/build-data.mjs && next build",
6-
"_ignoreCommandNote": "Vercel ignoreCommand uses INVERTED exit codes: exit 1 = BUILD (do not skip), exit 0 = SKIP. This is the opposite of Unix convention. The command below builds only the 'production' branch.",
6+
"_ignoreCommandNote": "Vercel ignoreCommand uses INVERTED exit codes: exit 1 = BUILD (do not skip), exit 0 = SKIP. This is the opposite of Unix convention. The command below builds only the 'production' branch. Deploy hook in ci.yml is configured for Branch 'production' so this always passes.",
77
"ignoreCommand": "bash -c '# Vercel exit code convention: exit 1=BUILD (do not skip), exit 0=SKIP (ignore). Opposite of normal Unix convention.\n[[ $VERCEL_GIT_COMMIT_REF == production ]] && exit 1; exit 0'",
88
"github": {
99
"enabled": false

0 commit comments

Comments
 (0)