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.

Pipeline: pull request, merge into main, automatic deploy, productionPull requestreview + CIMergeinto mainDeployautomaticProductionrollback ready
The path of a change, from pull request to production.

Branches and pull requests

One always-deployable main branch, short-lived branches, and minimum rules (branch protection):

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
CI pipeline stages: install, lint, test, buildInstallnpm ciLintstyleTestslogicBuildartifact
The four stages of the minimal pipeline; the merge is blocked if one fails.

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

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

  1. Week 1: protect main, require reviews, add a linter.
  2. Week 2: minimal CI as a merge gate.
  3. Week 3: secrets in GitHub, automatic deploy to a test environment.
  4. 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

Related reading