Skip to main content

Side by side

Continuous IntegrationvsContinuous Delivery

What is the difference between CI and CD?

Updated 3 min read8 differences

In short

CI merges and tests every change on the main branch automatically; CD keeps each tested build ready to release, and continuous deployment releases it.

Continuous Integration

Continuous integration is the practice of merging code changes into a shared main branch at least daily, with an automated build and tests checking every merge.

Read the page on Continuous Integration

Continuous Delivery

Continuous delivery is the practice of keeping software ready to release at any time, with an automated pipeline building, testing and preparing every change.

Read the page on Continuous Delivery

Continuous Integration and Continuous Delivery compared

AspectContinuous IntegrationContinuous Delivery
GoalProve that every merged change builds and passes the testsKeep every verified change ready to release to production
Starts withA push or pull request to the shared repositoryA build that has passed CI on the main branch
Ends withVerified code on the main branchA tested artifact that can go live in one routine step
Typical stepsInstall, compile, lint, run unit and integration testsDeploy to staging, run acceptance, performance and security checks
Feedback timeMinutes; about ten is a common targetLonger, as the artifact moves through each environment
Release decisionNone: CI doesn't deploy anythingA person approves, or the pipeline in continuous deployment
Key habitsSmall, frequent merges and fixing a red build firstBuild once, promote the same artifact, automate every environment
NeedsAutomated tests and a shared main branchWorking CI, automated deployments and monitoring

The difference, explained

Continuous integration (CI) is the practice of merging small changes into the shared main branch at least once a day, with an automated build and test run checking every merge. Continuous delivery (CD) picks up where CI ends: every change that passes moves on through an automated deployment pipeline, with staging environments and further tests, so the software can be released to production at any moment.

The essential difference is the question each one answers. CI asks whether the combined code still works, and ends with verified code on the main branch, ideally within about ten minutes of a push. CD asks whether that code can go live safely, and ends with a tested artifact, such as a container image, that can be released in one routine step.

The letters CD also stand for continuous deployment, which goes one step further and removes the manual approval: every change that passes the pipeline goes to production automatically, often many times a day. In continuous delivery a person decides when to release; in continuous deployment the pipeline decides. That needs a very reliable test suite, good monitoring and safety nets such as canary deployments, automatic rollbacks and feature flags.

They are stages of one pipeline rather than alternatives, which is why they are written together as CI/CD: CD builds on CI, and without CI there is nothing reliable to deliver. A common misconception is that having a CI tool means doing CI, but running builds on feature branches that live for weeks misses the point of integrating small changes often. Another is that continuous delivery means releasing constantly: it means being able to release at any time, while the timing can stay a business decision.

Which one should you use?

Choose Continuous Integration when…

  • You are starting out: CI is the foundation every delivery pipeline needs.
  • Merges are painful and broken builds are found days late.
  • You want fast feedback on every pull request.
  • Releases follow a fixed schedule, such as app store updates, but the code must stay healthy every day.

Choose Continuous Delivery when…

  • CI is already reliable, but releases are still slow, manual or risky.
  • You want to ship small changes whenever the business decides.
  • Every environment can be created and deployed automatically.
  • Tests, monitoring and rollbacks are strong enough to go on to continuous deployment.

A CI workflow and a CD workflow in GitHub Actions

Continuous Integrationyaml
# CI: verify every pull request and every push to main
on:
  pull_request:
  push: { branches: [main] }
jobs:
  verify:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v5
      - run: npm ci
      - run: npm test
      - run: npm run build
Continuous Deliveryyaml
# CD: deploy each verified build to staging, then to production
on: { push: { branches: [main] } }
jobs:
  staging:
    runs-on: ubuntu-latest
    steps: [{ uses: actions/checkout@v5 }, { run: ./deploy.sh staging }]
  production:
    needs: staging
    environment: production  # with required reviewers: continuous delivery
    runs-on: ubuntu-latest   # without them: continuous deployment
    steps: [{ uses: actions/checkout@v5 }, { run: ./deploy.sh production }]

Readers ask

Does CD mean continuous delivery or continuous deployment?

Both are used. Continuous delivery keeps every change ready and leaves the release to a person; continuous deployment releases every change that passes automatically. If production releases need an approval, it is continuous delivery.

Can you have CI without CD?

Yes, and many teams start that way: every change is built and tested, but releases are still prepared by hand. The reverse doesn't work, because continuous delivery depends on CI to supply verified builds.

Which tools are used for CI and CD?

Usually the same ones: GitHub Actions, GitLab CI, Jenkins and similar services run both the CI checks and the deployment pipeline. Some teams add dedicated deployment tools, such as Argo CD for Kubernetes.

More

Settings