How a CI/CD pipeline works
A CI/CD pipeline is an automatic checklist that runs every time code changes. Continuous integration builds and tests the change; continuous delivery or deployment ships it.
From commit to release
Push
Code to the repository
Build
Compile and install
Test
Automated checks
Package
Image or bundle
Deploy
Staging then production
Integration: catch problems early
Every push is built and tested on a clean machine, so a change that breaks the build or a test is seen in minutes and by everyone. Small, frequent changes are easier to fix than a large merge at the end.
Delivery and deployment
Continuous delivery keeps every passing build ready to release, with a person pressing the button. Continuous deployment releases it automatically. Both rely on fast tests and a way to roll back.
Keep it fast and trustworthy
A pipeline people avoid because it is slow or flaky stops being useful. Run quick checks first, cache dependencies and fix or delete flaky tests.
Questions
What is the difference between CI and CD?
CI builds and tests every change. CD (delivery or deployment) gets the passing build to users.
Which tools are used?
GitHub Actions, GitLab CI, CircleCI, Jenkins and others. The ideas are the same in all of them.
What is a staging environment?
A copy of production where a build is tried before real users get it.
How do I roll back?
Keep the previous package and redeploy it, or switch traffic back with a feature flag or blue-green setup.