Skip to main content
Albero Academy

CI/CD

Automate testing and deployment on every push.

Production9 min

CI/CD automates the path from a code change to production. Continuous Integration runs your tests on every push, so regressions are caught immediately; Continuous Delivery/Deployment ships passing code automatically. Together they make releases fast, frequent and safe.

A GitHub Actions pipeline

A workflow file defines steps that run on every push — check out the code, set up Python, install, test:

.github/workflows/ci.yml
name: CI
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with: { python-version: "3.12" }
- run: pip install -r requirements.txt
- run: ruff check . # lint
- run: pytest --cov # test with coverage

CI vs CD

  • CI — on every push/PR, run lint + tests so the main branch stays healthy and broken code never merges.
  • Continuous Delivery — every passing change is ready to release at the click of a button.
  • Continuous Deployment — every passing change ships to production automatically.

Key takeaways

  1. 01CI runs lint + tests automatically on every push/PR to keep main healthy.
  2. 02Continuous Delivery keeps every passing change ready to release; Deployment ships it automatically.
  3. 03GitHub Actions (and similar) define pipelines as YAML workflows.
  4. 04Require the CI check to pass before merging.
  5. 05Fast automated feedback makes releases routine, not risky.

Finished this chapter?

Mark it complete to track your progress through Python.