Add Convex prod deployment to CI/CD pipeline
Context
Convex production deployment (npx convex deploy) is currently manual. After merging to main, someone has to remember to run it locally. This is error-prone — Vercel deploys automatically but Convex doesn't, so the frontend and backend can drift.
What
Add a GitHub Actions workflow that runs npx convex deploy on push to main.
Requirements
- Trigger on push to
main(or on PR merge) - Run
npx convex deploy --cmd 'npm run build'withCONVEX_DEPLOY_KEYsecret - Only deploy if
convex/files changed (optional optimization) - Should run after tests pass
References
- Convex CI/CD docs: https://docs.convex.dev/production/hosting/
- Current prod deployment:
tacit-curlew-777 - Dev deployment:
valiant-bison-406
Came up during the better-auth integration (PR #1812) — adding auth plugins requires Convex redeployment which currently isn't automated.
This is straightforward now that Clerk is wired. The workflow needs:
- CONVEX_DEPLOY_KEY as a repo secret (from Convex dashboard)
- A workflow step running npx convex deploy
- Path filter for convex/** to avoid unnecessary deploys
@koala73 — should this deploy only on push to main, or also on PR merge events? Happy to open a PR.
Opened PR #2752 to automate Convex production deploys after the existing merge gate succeeds on main.
It deploys only when the gated merge commit changes convex/**, package.json, or package-lock.json, and uses CONVEX_DEPLOY_KEY from repository secrets.
PR: https://github.com/koala73/worldmonitor/pull/2752