Bootstrapping a GitLab CI Pipeline
August 10, 2026 · DevTools
A GitLab CI pipeline lives in a single .gitlab-ci.yml at the root of your repo, and its shape is simpler than it looks. You declare an ordered list of stages, then define jobs that each belong to a stage. Jobs in the same stage run in parallel; stages run one after another, and a failing stage stops the pipeline.
Each job names its stage, optionally an image to run in, a list of script commands, artifact paths to pass downstream, and rules that scope it to branches. A build job that runs npm ci and npm run build can expose dist/ as an artifact, which a later test job — restricted to main via a rule — consumes without rebuilding. That composition is the whole file: stages give order, jobs do the work, artifacts connect them, and rules decide when each runs.