CI vs Continuous Delivery vs Continuous Deployment
"CI/CD" is written as one word, but it names three different practices. Each one builds on the one before, and teams often say "we do CD" when they mean only the first.
| Practice | Definition | Who decides to release? |
|---|---|---|
| Continuous integration (CI) | everyone merges small changes into the shared main branch at least daily; every merge is built and tested automatically, and a broken build is fixed first | nobody yet: CI says "this change works with everyone else's" |
| Continuous delivery | every change that passes the pipeline produces a release candidate that could go to production at any time, with one approval | a person presses the button (or approves the environment) |
| Continuous deployment | every change that passes the pipeline goes to production automatically | the pipeline: no human step after the merge |
The terms come from Martin Fowler's writing on continuous integration and Jez Humble and David Farley's book Continuous Delivery (2010).
Continuous integration is a habit, not a server
Running Jenkins or GitHub Actions does not mean a team does CI. Three habits do:
- Merge to the main branch often: at least once a day per developer. Long-lived feature branches are the opposite of integration: two weeks of separate work produce two weeks of merge conflicts. This is why DevOps teams prefer trunk-based development (Git Workflow, GitHub Flow).
- Every merge runs the full automated checks: build, lint, unit tests, integration tests, security scans.
- A red main branch is everyone's top priority. If main is broken, nobody can trust what they merge on top of it.
Unfinished features still merge. They stay hidden behind a feature flag until they are ready, which separates deploying code from releasing a feature (Feature Flags).
The three practices in one model
Here are eight commits on the main branch, with the result of their pipeline. The model shows what reaches production under each practice. Under continuous delivery, the team approves a release at the end of each day.
commits = [ # (id, day, pipeline passed?)
("a1", 1, True), ("b2", 1, True), ("c3", 1, False), ("d4", 1, True),
("e5", 2, True), ("f6", 2, True), ("g7", 3, False), ("h8", 3, True),
]
def ci_only():
return [] # tested, but nothing is released automatically
def continuous_delivery():
released = []
for day in (1, 2, 3): # a human approves once a day
green = [c for c, d, ok in commits if d == day and ok]
if green:
released.append((day, green[-1])) # newest green build contains all before it
return released
def continuous_deployment():
return [(d, c) for c, d, ok in commits if ok] # every green commit ships
print("CI only :", ci_only())
print("Continuous delivery :", continuous_delivery())
print("Continuous deployment:", continuous_deployment())
print("Builds that failed :", [c for c, _, ok in commits if not ok])CI only : []
Continuous delivery : [(1, 'd4'), (2, 'f6'), (3, 'h8')]
Continuous deployment: [(1, 'a1'), (1, 'b2'), (1, 'd4'), (2, 'e5'), (2, 'f6'), (3, 'h8')]
Builds that failed : ['c3', 'g7']
Two details matter. First, d4 ships even though c3 failed before it: in CI, a failure is fixed by the next commit,
and the newest green build includes that fix. Second, under continuous delivery three releases carry the same six
changes that continuous deployment ships one by one. Smaller releases are easier to watch and to roll back, so
continuous deployment also needs strong tests and monitoring, because nobody looks at a change before it is live.
What it looks like in a pipeline
In GitHub Actions the difference between the last two practices can be one setting. This workflow tests every push
and pull request, deploys every push to main to staging, then to production. Whether the production job waits
for a person is configured on the production environment in the repository settings (required reviewers),
not in the YAML:
name: ci-cd
on:
push:
branches: [main]
pull_request:
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- run: make lint test
deploy-staging:
if: github.event_name == 'push'
needs: test
runs-on: ubuntu-latest
environment: staging
steps:
- uses: actions/checkout@v7
- run: ./deploy.sh staging
deploy-production:
if: github.event_name == 'push'
needs: deploy-staging
runs-on: ubuntu-latest
environment: production # required reviewers on this environment = continuous delivery
steps:
- uses: actions/checkout@v7
- run: ./deploy.sh productionWith required reviewers on production, this is continuous delivery. Remove them and it is continuous deployment.
The CI/CD Pipelines course builds real versions of this workflow (with image scanning and pushes to a
registry); Environments, Approvals & Concurrency covers the approval
settings.
Which one should a team aim for?
| Situation | Usually the right target |
|---|---|
| any team that writes software | CI, always |
| web services and APIs with good tests and monitoring | continuous deployment, or delivery with frequent approvals |
| mobile apps (store review), firmware, regulated releases | continuous delivery: always releasable, released on a schedule |
| a team without automated tests | CI first; deploying untested code automatically only makes failures faster |
Test yourself
What separates continuous delivery from continuous deployment?
- Continuous delivery has no automated tests
- In continuous delivery a person approves the release; in continuous deployment every passing change goes live automatically
- Continuous deployment only works with Kubernetes
- They are the same thing
A team runs a CI server but merges feature branches that live for three weeks. Are they doing continuous integration?
- Yes, because they have a CI server
- Not really: CI means integrating small changes into main at least daily
- Yes, if the builds are green
- Only if they use GitHub Actions
How can unfinished code be merged to main without users seeing it?
- Behind a feature flag
- By skipping the tests
- By deleting it before the release
- It cannot