A push starts it
A commit is a saved snapshot of your changes. Pushing sends it to the shared repository your team works from. Continuous integration (CI) means everyone does this often, at least daily, in small pieces, and a machine checks every one.
Nobody presses a button: the push itself starts a pipeline, a list of checks that a CI server runs on a fresh machine, in order, every time. GitHub Actions, GitLab CI and Jenkins are popular services that run pipelines like this.
The checks
The server starts from a clean machine. pip install . installs your project and every package it says it needs. Code that only worked on your laptop, because of something you once installed by hand, fails right here.
A linter reads the code without running it and flags likely mistakes, such as a name that is never defined or an import that is never used. ruff check . is one Python linter. Nothing found: the lamp turns green.
pytest runs the unit tests. One checks that add(2, 3) gives 5, but this commit's add subtracts and returns -1. The test fails, its lamp turns red, and the pipeline stops: build is skipped.
When a check fails
The team protects the main branch: a change may merge only when every required check has passed. This one failed, so merging stays locked, and the broken code never reaches the branch everyone else builds on.
The red result reaches you within minutes, while the change is still fresh in your mind. You change the minus to a plus, commit and push again. That new push will start the whole pipeline again.
Green to release
Install, lint, test, build: this time every lamp turns green, one after another. The build stage packages the code into files ready to install or ship. Each stage runs only after the one before it has passed.
With every check green, merging is allowed. Main now holds the new code, and it is known to install, lint clean and pass its tests. Small changes, merged often, each one checked: that is continuous integration.
Continuous delivery goes further: every green build is ready to release, and a person presses the button. Continuous deployment drops the button: each green change goes live automatically. Here version 1.1 reaches the users.
What happens
;; step 1/10 · push
$ git commit -m "Add add()"
$ git push
commit a saved snapshot of your changes
push send it to the shared repository
CI small changes, merged often (at least daily),
each one checked by a machine
Blocking the merge is a setting on the shared repository (on GitHub, a branch protection rule with required status checks), not something the pipeline does by itself. Martin Fowler gives a ten-minute guideline for the main commit build: slower pipelines lose the fast feedback that makes CI work.