CI/CD for a small development team
By Kallistesoft · · 3 min read
In a large company, continuous delivery is carried by a platform team. In a team of two to ten, you build it yourself. What works: few rules, applied consistently, and automation that grows with the team.
Branches and pull requests
One always-deployable main branch, short-lived branches, and minimum rules (branch protection):
- No direct commits to
main: everything goes through a pull request. - At least one review. Working alone? Reread your own pull request the next morning.
- Pull requests readable in fifteen minutes: a 2,000-line one is not reviewed, it is approved.
- Merging allowed only when automated checks pass.
A minimal pipeline
The first pipeline does little, but on every pull request: install, lint, test, build (GitHub Actions).
name: CI
on:
pull_request:
push:
branches: [main]
jobs:
verify:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with: { node-version: 20, cache: npm }
- run: npm ci
- run: npm run lint
- run: npm test
- run: npm run build
Use npm ci for reproducible installs, cache dependencies, and aim for under ten minutes: beyond that, people work around the pipeline. For gates, start with a linter and formatter, then tests on what is expensive when it breaks (calculations, payments, migrations). Do not chase 100% coverage. Fix or remove a flaky test quickly; rerunning "until it passes" destroys trust.
Deploy on merge
Once the base is stable, deploy when main changes. This site works that way: a merge triggers an action that uploads the files over FTPS. Nothing fancy, but repeatable.
deploy:
needs: verify
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
environment: production
steps:
- uses: actions/checkout@v4
- run: ./scripts/deploy.sh
env:
FTP_PASSWORD: ${{ secrets.FTP_PASSWORD }}
The environment key lets you require a manual approval (docs).
Secrets and rollbacks
- Never put passwords or keys in the repository, even a private one: Git history is permanent. Use GitHub secrets with least privilege (an FTP account limited to the site folder).
- Leak? Revoke first, clean up after.
- Rollback: redeploy a previous commit or revert the merge. Keep database migrations separate from code; dropping a column cannot be undone. Try it once in calm conditions.
Mobile: build and signing
Automate early the build, tests, build number and test distribution (Firebase App Distribution, TestFlight, Google Play test tracks). Signing demands discipline (Android docs): keys stay out of the repository, stored encoded in secrets and backed up elsewhere, because losing a key can block your updates.
Not yet
Keep a human step for final store publication, avoid exhaustive end-to-end suites (slow and brittle), and resist Kubernetes for an app that fits on one server.
Four-week plan
- Week 1: protect
main, require reviews, add a linter. - Week 2: minimal CI as a merge gate.
- Week 3: secrets in GitHub, automatic deploy to a test environment.
- Week 4: production on merge, rollback rehearsed.
Conclusion
A small team's CI/CD should be reliable and understood by everyone, not impressive. Add the rest when a real problem justifies it.
Sources
- Quickstart for GitHub Actions — GitHub Docs
- About protected branches — GitHub Docs
- Using secrets in GitHub Actions — GitHub Docs
- Using environments for deployment — GitHub Docs
- Sign your app — Android Developers