
In a software team everyone writes code; but how does it get merged, tested and go live? Done by hand it is slow and error-prone. CI/CD is an approach that automates this process: continuous integration (CI) and continuous delivery/deployment (CD). This guide covers the concepts, pipeline steps and benefits. For version control see our Git guide.
What is CI?
Continuous integration means developers push code to the shared repository often (several times a day) and automatic builds and tests run on every push. That way integration problems are noticed early rather than late. For collaboration see our GitHub guide.
What is CD?
| Term | Meaning |
|---|---|
| Continuous delivery | Code that passes tests is kept ready for release at any time; release is done with an approval |
| Continuous deployment | Code that passes tests goes live automatically without approval |
Most teams start with delivery; in critical systems human approval can be kept for the last step.
Typical pipeline steps
- 1
A developer pushes code to the repository
- 2
The system triggers automatically
- 3
The code is built and dependencies installed
- 4
Tests and code quality checks run
- 5
If successful the package is prepared and goes to a test environment
- 6
It goes live on approval or automatically
- Trigger: a push or a merge request.
- Build: making the code runnable.
- Test: unit, integration and, if needed, end-to-end tests.
- Quality and security checks: code scanning, dependency security scanning.
- Packaging: a container image or release package (see our Docker guide).
- Deployment: test, staging and live environments.
- Monitoring: tracking errors and performance after release (see our uptime monitoring guide).
Benefits
- Fast feedback: a bug is noticed within minutes.
- Fewer manual errors: the process is repeatable.
- Frequent, small releases: risk drops.
- Quality: tests run on every change.
- Time saving: developers aren't busy with release chores.
- Easy rollback: you can quickly return to a problem version.
Deployment strategies
| Strategy | Idea |
|---|---|
| Rolling | Update servers one by one |
| Blue-green | Two environments; shift traffic to the new version |
| Canary | Open the new version to a small group of users first |
For traffic distribution see our load balancer guide.
Tools
Many platforms offer CI/CD: built-in features of repository hosting services, standalone CI servers and cloud provider services. The choice depends on team size, budget and infrastructure (see our GitHub and cloud providers guides).
Security notes
- Put secrets (keys, passwords) not in the code but in the pipeline's secure secret store (see our API key security guide).
- Minimise permissions; don't give the pipeline more access than needed.
- Take dependencies from trusted sources and scan them (see our open source guide).
- Limit deployment rights to protected branches.
A roadmap for beginners
- Learn version control (Git).
- Write automated tests in a small project.
- Set up a simple pipeline: run tests on push.
- Then add automated deployment.
- Build monitoring and a rollback plan.
Common mistakes
- Setting up a pipeline without writing tests.
- Putting secrets in the repository.
- A pipeline that is too slow; fast feedback is lost.
- Ignoring a failing pipeline.
- Deploying automatically without a rollback plan.
Frequently asked questions
Is CI/CD only for big teams? No; it saves time on one-person projects too.
Is it CI/CD without tests? The build is automated but the real value comes with tests.
Summary
CI/CD makes code build and test automatically and go live safely. Start small: version control, automated tests and a simple pipeline.
Serkan Akyürek is the founder and author of toolrota; he writes step-by-step guides on Excel, AI, the cloud, personal finance and digital security.