How-to guide

How to set up a CI/CD pipeline for a small team

Learn how to build a CI/CD pipeline your small team can run: repository setup, build, tests, secrets, environments, deploys and rollback.

By the Cloudverg engineering team · · 6 min read

Why this matters

Most small teams deploy by hand. One engineer runs the script, remembers the migration order and knows which environment to touch first. That knowledge lives in one head, and releases stop when that person is on vacation. A pipeline writes the steps down in a file that everyone can read, review and change.

The second gain is feedback speed. When tests run on every pull request, a broken change is caught in minutes on the author's branch instead of in production at night. Reviewers stop arguing about whether the code builds and start talking about the change itself.

Keep the ambition small. A team of three to fifteen engineers does not need dozens of stages. It needs a pipeline that builds, tests and packages the same artifact every time, deploys to staging automatically, and puts production behind a deliberate click with a rollback that actually works. How to set up a CI/CD pipeline for a small team is mostly about removing manual steps one at a time, in an order you can undo.

Before you start

Watch one release and write down every step. Include the parts nobody documents: the database migration, the cache clear, the CDN or DNS change, the config tweak that only happens in production. Sort each step into automate now or automate later. The second list is where most of the hidden risk sits.

Pick one CI system and stay with it. If your code lives on GitHub, GitHub Actions is the shortest path. GitLab CI fits GitLab, and Bitbucket Pipelines fits Bitbucket. Confirm the system can reach your cloud account or servers and that it supports protected environments with required reviewers, because that is how you gate production later.

Agree on environments and access before you write any configuration. Development for merged code, staging that mirrors production, and production behind an approval step. Name who can approve a production deploy and where that rule is written down.

Get permissions in place early. You will likely need repository admin rights to change branch protection, a cloud role to create the deploy identity, and a place to store secrets. Budget a few days for this, since approval queues inside a company usually take longer than the pipeline file itself.

How to do it

Start with continuous integration only: run the tests and the build on every pull request. Add deployment to staging once that has been green for a week. Add production last, behind a manual approval. Each addition should be reversible on its own.

Keep the pipeline file in the repository next to the code and review changes to it like any other change. A pipeline that only one person can edit, or that lives in a web console, will drift out of sync with the code within a month.

The sequence below is the one that keeps small teams out of trouble. Expect the first working version to take days, not weeks, if your tests are reasonably fast and your deploy is already a script you can call.

Build the artifact once and promote it. If the staging deploy compiles the code again, you are testing something different from what reaches production. Tag the artifact with the commit hash so you can find it and redeploy it later.

  1. Put the code in one repository. Consolidate the service into a single repository with a protected default branch. Confirm that everyone can clone it and run the tests locally with the documented commands.
  2. Write the current release process down. Create a short RELEASING file listing every manual step in order, including migrations and cache clears. Mark which steps the pipeline will replace first.
  3. Add a pull request workflow. Create a workflow file that installs dependencies, runs the linter, runs the unit tests and compiles the build on every pull request. Keep it under ten minutes by caching dependencies.
  4. Make checks required. Turn on branch protection for the default branch and require the workflow to pass before merging. Require at least one review so a failed check cannot be bypassed easily.
  5. Build one immutable artifact. Produce a container image or archive once per commit and tag it with the commit hash. Push it to a registry and use that same artifact for every environment.
  6. Deploy to staging on merge. Run migrations, deploy the tagged artifact to staging and execute a smoke test against the health endpoint. Fail the job loudly if the smoke test does not pass.
  7. Gate production behind approval. Use a protected environment with required reviewers for the production job. Deploy the identical artifact that passed staging, never a fresh build.
  8. Set up secrets and deploy roles. Move credentials into your CI provider's secret store and switch to short lived credentials where the cloud supports it. Scope the deploy role to the resources it actually touches.
  9. Add a rollback path. Create a job that redeploys the previous tag with one click, and test it during a maintenance window. Point the team at the dashboards and logs that show whether the rollback worked.

How to check it worked

Test the pipeline the way you test code. Open a pull request with a test that must fail and confirm the merge button is blocked. Push a change that breaks the build and confirm nothing lands in staging. Break the Dockerfile on purpose and watch the job fail where you expect it to.

Measure three numbers: time from opening a pull request to green checks, time from merge to staging running, and time from approval to production. Watch the failure rate as well. A pipeline that is green most of the time gets trusted, and one that fails at random gets ignored.

Run a rollback drill before you need it. Deploy a known good version, then redeploy the previous tag while someone watches the dashboards. Confirm the logs, health checks and alerts all point at the version you just restored.

Ask one engineer who did not build the pipeline to ship a small change using only the documented process. If they need help, the documentation or the pipeline still has a gap.

Mistakes to avoid

Overbuilding is the most common failure. Teams add build matrices, five environments, parallel integration suites and a plugin for every need, then spend their Fridays fixing the pipeline instead of shipping. Start with one build, one test job and two environments. Add stages when a real problem demands them.

Long lived cloud keys stored as secrets are the next trap. Prefer short lived credentials through OpenID Connect from your CI provider to your cloud, and give the deploy role only the permissions it needs. Rotate anything long lived on a schedule and keep secrets out of logs.

Slow pipelines quietly kill the habit. Cache dependencies, run independent test groups in parallel, and fail fast so a broken build reports in minutes. Quarantine flaky tests instead of rerunning the whole job, or people will learn to click rebuild without reading the output.

If building this platform in house is not realistic for your team, an outside option exists. Cloudverg's Delivery platform setup package is a fixed price of $14,500 over four weeks, covering pipelines, separate development, staging and production environments, secret management, infrastructure as code, monitoring and a tested rollback. It is one option among several, and the manual steps in this guide still apply whichever route you take.

Frequently asked questions

How long does it take to set up a CI/CD pipeline for a small team?

A basic pipeline with tests, a build and a staging deploy typically takes a few days of focused work if the tests already exist. Production deployment, secrets and rollback usually add another week. Most of the time goes into permissions and untangling manual release steps, not into writing the workflow file.

Do we need Kubernetes to run CI/CD?

No. A container registry, a workflow runner and a single server or managed app platform are enough for most small teams. Kubernetes adds scheduling, networking and access complexity that a team of five rarely needs. Add it when you have a concrete reason, such as many services with independent scaling needs.

How should a small team handle secrets in a pipeline?

Store secrets in the CI provider's secret store or a managed vault, never in the repository. Prefer short lived credentials issued through OpenID Connect to your cloud over long lived keys. Give each environment its own secrets and scope deploy roles to the minimum set of resources.

Fixed price

Want help with this? Delivery platform setup

$14,500 fixed price

4 weeks · Starts within 10 business days

Four weeks to give your engineers a delivery platform: pipelines, environments, secrets, monitoring and rollback they can trust.

What is included

Related guides

More devops and platforms guides   Engineering systems

Smallest way to start

Get a senior architect on your problem this week

Ninety minutes on the cloud, AI or security question that is blocking you, a pre-read of your material and a written summary within two business days.

$450 one-time