Advanced level · Module 4: Deployment and Operations · Lesson 2 of 4
CI/CD Pipelines
Automate tests and deployments so every change is checked and released the same way.
In this lesson you will
- Create a pipeline that runs tests on every push
- Deploy automatically from the main branch with migrations
Key concepts
continuous integrationcontinuous deploymentpipeline stepsrunning migrations on deploy
The lesson
Continuous integration runs the build, linting and tests automatically on every push and pull request, so problems are found before merging. Services such as GitHub Actions run these pipelines from a configuration file in the repository.
Continuous deployment releases automatically when tests pass on the main branch. Database migrations must run as part of the deployment, before the new code needs the new schema.
Keep a quick way to roll back: redeploy the previous version and, if needed, run the down migration.
Step by step
- Write a pipeline that installs, lints and tests the project.
- Make pull requests require the pipeline to pass.
- Add a deployment step for main.
- Practise a rollback.
Practice activity
Set up CI/CD for the booking platform.
Expected result: Every pull request is tested automatically and merges to main deploy without manual steps.
Check your understanding
-
What does continuous integration do?
Show answer
Automatically builds and tests every change.
-
When should database migrations run during deployment?
Show answer
Before the new code that depends on them starts serving requests.
Taught live by an instructor — online or in person. Free course lessons are for self-study and do not lead to a certificate — see registration options.