This document describes the continuous integration and deployment setup for the VIA backend.
The .github/workflows/ci.yml workflow runs on every push and pull request to main and build/setup-ci.
Steps:
- Lint —
npm run lint(ESLint) - Test —
npm test(Jest + Supertest) - Verify — Start server and hit
/healthto confirm it runs
| Command | Description |
|---|---|
npm run lint |
Run ESLint on src/ |
npm test |
Run Jest tests in test/ |
To require CI to pass before merging into main, configure branch protection in GitHub:
- Go to Settings → Branches → Add branch protection rule
- Set Branch name pattern to
main - Enable Require status checks to pass before merging
- Search for and select verify (the CI job name)
- Optionally enable Require branches to be up to date before merging
- Save
After this, pull requests targeting main must have a passing CI run before they can be merged.
If you have GitHub CLI installed:
gh api repos/:owner/:repo/branches/main/protection \
-X PUT \
-H "Accept: application/vnd.github+json" \
-f required_status_checks='{"strict":true,"contexts":["verify"]}' \
-F enforce_admins=false \
-F required_pull_request_reviews='null' \
-F restrictions='null'Replace :owner and :repo with your repository's owner and name.
The backend is deployed on Render. When the repo is connected:
- Auto-deploy: Pushes to
maintrigger a new deployment - Build:
npm install - Start:
npm start
Render deploys independently of GitHub Actions. To deploy only after CI passes, either:
- Use branch protection (above) so only CI-passing code reaches
main, or - Disable auto-deploy and use a deploy hook triggered from the CI workflow