What is CI/CD? Continuous Integration and Delivery in Practice
A practical DevOps definition, with an example you can use.
CI/CD is the practice of automatically building, testing and releasing code every time it changes. Continuous integration (CI) means developers merge small changes into a shared branch often, and each change is built and tested automatically. Continuous delivery (CD) means every change that passes is packaged and ready to release at any time. Continuous deployment goes one step further and releases each passing change to production with no manual step.
Why CI/CD matters
Without CI/CD, teams merge big batches of work, discover conflicts late and release rarely, often through long manual checklists. Releases become stressful events, and bugs are hard to trace because so much changed at once.
CI/CD reverses that. Small changes are tested within minutes, problems are caught while the code is still fresh in the author's mind, and releasing becomes routine. Teams that deploy often with low failure rates are what the DORA metrics measure, and CI/CD is the main way to get there.
How a CI/CD pipeline works
A pipeline is a sequence of automated stages, defined in a file in the repository:
- Trigger: a push or pull request in Git.
- Build: compile the code or build a container image.
- Test: run unit and integration tests, linting and security scans.
- Package: produce a versioned artifact and push it to a registry.
- Deploy to staging: release the artifact and run smoke tests.
- Deploy to production: automatically or after approval, then verify with health checks and metrics.
If any stage fails, the pipeline stops and the team is notified.
A realistic example
A small GitHub Actions workflow that tests every pull request and, on main, builds and pushes an image:
name: ci
on:
pull_request:
push:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- run: npm ci
- run: npm test
build:
if: github.ref == 'refs/heads/main'
needs: test
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- run: |
docker build -t ghcr.io/acme/orders-api:${{ github.sha }} .
docker push ghcr.io/acme/orders-api:${{ github.sha }}
A deploy job, or a GitOps tool watching a manifests repository, then rolls the new image out.
CI vs CD vs continuous deployment
- Continuous integration is about the code: merge often, test automatically, keep
mainworking. - Continuous delivery is about release readiness: every passing build could go to production today.
- Continuous deployment removes the final manual approval.
Many teams practise continuous delivery for production and continuous deployment for staging.
Common mistakes
- Slow pipelines. If CI takes 45 minutes, people batch changes and stop waiting for it. Cache dependencies, run tests in parallel and keep the main path fast.
- Flaky tests. Tests that fail randomly teach everyone to click "re-run". Fix or quarantine them.
- Rebuilding per environment. Build once, deploy the same artifact everywhere.
- Long-lived credentials in pipeline settings. Use short-lived cloud credentials through OIDC where possible.
- No rollback path. Fast deployment needs fast recovery. Automate rollback alongside deploy.
CI/CD in day-to-day work
DevOps and platform engineers write and maintain pipeline definitions, speed up slow builds, manage runners, add security scanning, wire pipelines to cloud accounts and Kubernetes, and debug failed runs. Tools you will meet include GitHub Actions, GitLab CI, Jenkins and Argo CD. The CI/CD pipeline tutorial for beginners builds a first pipeline step by step, the DevOps tools guide compares tools, and the CloudPros curriculum shows where pipelines are built.
Reference
Read the primary documentation for the underlying concept and further detail.
Frequently asked questions
What is CI/CD?
CI/CD stands for continuous integration and continuous delivery (or deployment). CI means developers merge small changes often, and every change is automatically built and tested. CD means every change that passes is automatically prepared for release, and with continuous deployment, released to production without manual steps.
What is the difference between continuous delivery and continuous deployment?
With continuous delivery, every change that passes the pipeline is ready to deploy, but a person decides when to release to production. With continuous deployment, every passing change goes to production automatically. Both depend on strong automated testing.
What are the most common CI/CD tools?
Widely used tools include GitHub Actions, GitLab CI/CD, Jenkins, CircleCI, Azure Pipelines and AWS CodePipeline. For Kubernetes deployments, GitOps tools such as Argo CD and Flux often handle the delivery side, with a CI tool building and testing the artifacts.
What are the stages of a CI/CD pipeline?
A typical pipeline has a source stage triggered by a commit or pull request, a build stage that compiles code or builds a container image, a test stage with unit, integration and security checks, an artifact stage that stores the versioned build, and deploy stages for staging and production with verification after each.
