FediChess uses GitHub Actions to run CI (lint + build) on every push and pull request. You can require this check to pass before Vercel promotes a deployment to Production, so only green builds go live.
The workflow .github/workflows/ci.yml runs on:
- Push to
mainormaster - Pull request targeting
mainormaster
Steps:
- Checkout the repository
- Set up Node.js 20 (with npm cache)
npm install— install dependencies (CI uses install for lockfile compatibility across npm versions; usenpm cilocally when possible)npm run lint— ESLint (Next.js config)npm run build— production Next.js build (static export)
If any step fails, the workflow fails. Fix the branch and push again.
- Open your Vercel project (e.g. Vercel Dashboard → your FediChess project).
- Go to Settings → Git → Deployment Checks (or Build & Deployment for this project).
- Under Deployment Checks, enable Require checks to pass before deploying (or equivalent).
- Add the check named CI (or the exact workflow name: Build and lint).
Vercel lists available checks from your GitHub repo; select the one that corresponds to.github/workflows/ci.yml. - Save.
After this, when you push to the production branch (e.g. main), Vercel will:
- Start a deployment.
- Wait for the CI workflow to complete.
- Promote to Production only if CI succeeds. If CI fails, the deployment stays in a non-production state (e.g. preview or blocked).
To avoid failing CI after a push, run the same steps locally:
npm ci
npm run lint
npm run buildUse the same Node version as CI (20) if possible (e.g. nvm use with .nvmrc).
- Check not appearing in Vercel: Ensure the workflow file is on the default branch and has run at least once (e.g. push a commit or open a PR).
- CI passes but Vercel build fails: Vercel runs its own build; CI only mirrors it. Check Vercel build logs and environment (e.g. Node version, env vars).
- Branch name: If your default branch is
masterinstead ofmain, the workflow already runs on both; no change needed.