Cloud & DevOps
CI/CD for small teams: a pipeline you can set up in a day
A minimal, reliable CI/CD pipeline: lint, test, build on every change, deploy from main, preview environments, secrets handling and a tested rollback.
By Envexa Engineering6 min read
You do not need a platform team to have reliable releases. A small team can get most of the benefit with a single pipeline that checks every change and ships the main branch automatically. The goal is simple: a green build means it is safe to release, and releasing is boring.
Step 1: check every change
On every pull request, install dependencies from the lock file, run the linter and type checker, run the tests, and build. If any step fails, the change cannot merge. Here is a minimal GitHub Actions example for a Node project:
name: ci
on:
pull_request:
push:
branches: [main]
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- run: npm ci
- run: npm run lint
- run: npm test --if-present
- run: npm run buildStep 2: protect the main branch
Require the check to pass and at least one review before merging, and disallow direct pushes to main. This is a setting, not code, and it turns the pipeline from a suggestion into a rule.
Step 3: deploy from main
When a change merges to main, deploy automatically. Many hosting platforms can build from your repository directly, so the "deploy job" may be just connecting the repo. If you deploy yourself, run the same build, then publish the exact artefact that passed the checks rather than rebuilding it differently.
Step 4: preview environments
A temporary environment per pull request lets reviewers and stakeholders try the change before it merges. It catches problems tests cannot, like confusing copy or a layout break, and it shortens review cycles.
Secrets and configuration
- Keep secrets in your CI provider's secret store and your host's environment, never in the repository or build logs.
- Use separate credentials for each environment, with the minimum permissions each needs.
- Fail fast at start-up if required configuration is missing, rather than failing later in production.
Rollback, rehearsed
Decide now how you will undo a bad release: redeploy the previous version, or switch back to it. Make database changes backwards compatible so rollback is safe, as covered in zero-downtime database migrations. Then practise it once, on purpose, so the first time is not during an incident.
Keep it fast and trusted
Cache dependencies, run independent jobs in parallel, and quarantine flaky tests quickly, because a pipeline that fails randomly teaches people to ignore it. Add security checks such as dependency scanning gradually. For container-based services, our production checklist for Dockerised FastAPI covers what to build into the image.
Frequently asked questions
What is the difference between CI and CD?
Continuous integration automatically builds and tests every change so problems are found early. Continuous delivery or deployment automatically releases a passing change to an environment, ideally with a way to roll back.
Do small teams really need CI/CD?
Yes, arguably more than large ones, because there is no spare person to catch mistakes. A basic pipeline is a few hours of work and prevents the most common class of broken releases.
How long should a CI pipeline take?
Aim for under ten minutes for the checks that run on every pull request. Slow pipelines get bypassed. Cache dependencies and run independent checks in parallel.
Related articles
A production checklist for Dockerised FastAPI services
A practical checklist for running FastAPI in Docker in production: images, workers, health checks, configuration, logging, migrations, shutdown and CI.
Zero-downtime database migrations: the expand and contract pattern
Change your PostgreSQL schema without downtime: expand and contract, safe index creation, lock timeouts, batched backfills and a pre-deploy checklist.