GitLab CI Generator
Generate a .gitlab-ci.yml pipeline without memorising GitLab's YAML keywords. Choose a language, tick the stages you want — build, test, lint, deploy — and the tool writes jobs with the right base image, install commands, dependency caching, and artifacts passed between stages. Copy it to the root of your repo and the pipeline runs on your next push. Everything is generated in your browser.
How to use the GitLab CI Generator
Pick your language to load a sensible base image and the install, lint, test, and build commands for that ecosystem. Tick the stages you want — most projects run build, lint, and test on every change and add deploy once a release target exists. Leave caching on so dependencies are restored between pipelines instead of downloaded every time, which is usually the single biggest speed-up. The file regenerates live; save it as .gitlab-ci.yml in the repository root.
The generated jobs use conventional commands (for example npm ci, pytest, go test ./...), so adjust them to match your actual scripts and test runner. The deploy job is intentionally a stub guarded to run only on the default branch — replace its script with your real deployment, whether that is pushing an image, calling a deploy API, or using GitLab environments. Pipelines run automatically on push once the file is committed; check the results under Build → Pipelines in GitLab.
How GitLab CI pipelines work
GitLab CI/CD is configured by a single file, .gitlab-ci.yml, at the root of your repository. When you push, GitLab reads it and builds a pipeline — a set of jobs organised into stages that run in sequence. Jobs in the same stage run in parallel; the next stage starts only once the previous one succeeds. A typical ordering is build, then lint and test, then deploy, so a failing test never reaches production.
Each job declares an image (a Docker image the job runs inside), a stage, and a script of shell commands. GitLab Runners pick up jobs and execute them in clean containers, which is what makes builds reproducible. Two keywords do most of the heavy lifting for speed and data flow: cache persists directories like node_modules or .cargo across pipelines so dependencies are not re-downloaded every run, and artifacts pass files produced by one job — compiled output, a coverage report — to later stages and make them downloadable from the UI.
Control over when jobs run comes from rules (and the older only/except). You can run the full pipeline on merge requests and the default branch, skip expensive jobs on documentation-only changes, or gate deployment behind a manual approval. Combined with environments, which track what is deployed where, this lets a single file describe everything from a quick lint check to a multi-stage production rollout. This generator produces a clean starting pipeline with the common stages and caching wired up, which you then tailor to your project's scripts and deployment target.
Common use cases
- New repositories. Add a working CI pipeline in one step instead of writing YAML from scratch.
- Standardising builds. Give every project the same build, lint, and test stages with caching.
- Learning GitLab CI. See how stages, jobs, cache, and artifacts fit together for your language.
- Faster pipelines. Add dependency caching to a project that currently reinstalls every run.