🎓 A1Learner
🔍
0 of 50 lessons completed

CI/CD: Continuous Delivery vs Continuous Deployment

Continuous delivery and continuous deployment both keep code ready to ship. Delivery waits for a person to say go, while deployment ships on its own.

Delivery

The code is ready. A person starts the release.

tests pass
code waits
person starts the release
users get the new version

Deployment

The code is ready. The release starts on its own.

tests pass
release starts on its own
users get the new version

The one difference

The two paths differ in one line only.

delivery:   a person starts it
deployment: it starts itself

Example

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - run: npm test
  deploy:
    needs: test
    runs-on: ubuntu-latest
    steps:
      - run: npm run build

Key points

  • Continuous delivery: every change is ready to ship, and a person starts the release.
  • Continuous deployment: every change ships to users on its own, once the tests pass.
  • A release is the version of the code that reaches users.
  • Use delivery when a person must approve each release.
  • Use deployment when releases are small, tested and safe to ship often.
  • Both need the same tests. The difference is who starts the release.
  • Delivery means ready to ship. Deployment means shipped.

In this example, the workflow has two jobs. The test job runs the tests. The deploy job builds the app for release. The needs line is new here. It means the deploy job waits for the test job. A later lesson explains it in full.

Note

A failed test stops both paths. Nothing ships while tests are red.

Try it Yourself

Edit the code, then press Run.

Running is simulated · Rust Playground

Exercise

What is the difference between continuous delivery and continuous deployment?