Introduction
Continuous Integration (CI) is the practice of merging every developer's code changes into a shared branch frequently, often multiple times a day, with an automated build and test run triggered on every merge. Continuous Delivery and Continuous Deployment (both abbreviated CD) pick up where CI leaves off: they automate getting a validated build out toward, or all the way into, production. The two terms are often said together as CI/CD, but they solve different problems: CI is about catching integration problems early, while CD is about removing manual steps from getting working code released.
Cricket analogy: A squad doesn't wait until the final trial to see if new players mesh with the team; they scrimmage together constantly so combination problems surface early, the way CI merges code constantly to catch integration issues, while CD is the separate process of actually fielding the settled squad on match day.
Explanation
A typical CI pipeline triggers on every push: it checks out the code, installs dependencies, compiles or builds the project, and runs the automated test suite, reporting success or failure back to the developer within minutes. Because integration happens so often, when something breaks, it is usually caused by a small, recent change, which makes the cause far easier to find than if branches had diverged for weeks before merging.
Cricket analogy: Because a squad scrimmages daily rather than once a month, if a new drill breaks team cohesion, coaches immediately know it's linked to that day's change rather than something buried weeks back, just as CI's constant merges make the cause of a failure easy to pinpoint.
Continuous Delivery automates every step up to production but keeps a manual approval gate before the final release, giving a human the chance to decide when code actually goes live. Continuous Deployment goes one step further and removes that manual gate entirely: every change that passes all automated checks is released to production automatically, with no human in the loop. Choosing between the two is a risk and maturity decision, not a technical limitation, since both rely on the same underlying automated pipeline.
Cricket analogy: A franchise might have every training and selection step automated but still have the head coach personally sign off before naming the final playing eleven, mirroring Continuous Delivery's manual gate, whereas a fully automated team-selection algorithm with no coach override would be Continuous Deployment.
Example
# CI stage: runs on every push, fails fast
on: [push]
jobs:
ci:
steps:
- run: npm ci
- run: npm test
# CD stage (Delivery): requires manual approval before deploy
jobs:
deliver:
needs: ci
environment:
name: production
# GitHub Environments can require a manual reviewer approval here
steps:
- run: npm run deployKey Takeaways
- CI means merging code frequently with an automated build and test on every push.
- CD automates getting validated code toward or into production, on top of CI.
- Continuous Delivery keeps a manual approval gate before release; Continuous Deployment removes it.
- Frequent integration in CI makes the cause of a failure easier to isolate.
Practice what you learned
1. What does CI primarily automate?
2. What is the key difference between Continuous Delivery and Continuous Deployment?
3. Why does frequent CI integration make failures easier to isolate?
4. What triggers a CI pipeline?
5. Is CD possible without CI?
Was this page helpful?
You May Also Like
DevOps Lifecycle
How the DevOps lifecycle chains Plan, Code, Build, Test, Release, Deploy, Operate, and Monitor into one continuous, automated feedback loop.
What Is a Pipeline
What a CI/CD pipeline is: a sequence of automated stages that take source code through build, test, and deploy steps in order.
Containers vs VMs
How containers and virtual machines differ in what they virtualize, how fast they start, and how much overhead they carry per instance.
Related Reading
Related Study Notes in DevOps
Browse all study notesNginx Study Notes
DevOps · 30 topics
DevOpsAnsible Study Notes
DevOps · 30 topics
DevOpsAdvanced Kubernetes Study Notes
Kubernetes · 30 topics
DevOpsAdvanced Bash Scripting Study Notes
Bash · 30 topics
DevOpsApache Kafka Study Notes
Kafka · 30 topics
DevOpsDocker & Kubernetes Study Notes
YAML · 40 topics