DevTools Logo

GitLab CI Generator

GitLab CI Generator

Build a .gitlab-ci.yml from stages and jobs — images, scripts, artifacts, and branch rules.

Pipeline

Job 1

Job 2

.gitlab-ci.yml

image: node:20

stages:
  - build
  - test

build:
  stage: build
  script:
    - npm ci
    - npm run build
  artifacts:
    paths:
      - dist/

test:
  stage: test
  rules:
    - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "main"'
  script:
    - npm test
client-side
YAML

Examples

Build then test

Input
stages: build, test
job build (stage build): npm ci / npm run build, artifacts: dist/
job test (stage test, only main): npm test
Output
stages:
  - build
  - test
build:
  stage: build
  script:
    - npm ci
    - npm run build
  artifacts:
    paths:
      - dist/

Stages run sequentially; the test job is scoped to main via a rule and the build job exposes an artifact.

About this tool

The GitLab CI Generator turns a list of stages and jobs into a valid .gitlab-ci.yml file. You define the stages in order, set an optional default image, and add jobs with a stage, image, script, artifacts, and the branches they run on. The output is plain YAML you commit to your repo — nothing is uploaded.

How to use

  1. List the stages

    Enter stages like build, test, deploy in the order they should run.

  2. Add jobs

    For each job give a name, stage, image, script commands, artifact paths, and optional branch rules.

  3. Copy and commit

    Copy the .gitlab-ci.yml into your repo root and push — GitLab runs it on the next pipeline.

Use cases

New project bootstrap

Stand up a CI pipeline for a fresh repo without hand-writing YAML.

Branch-scoped deploys

Restrict deploy jobs to protected branches.

Common mistakes

Mistake:Forgetting the stage list.

Fix:Every job references a stage; list all stages up front or the pipeline errors.

Frequently asked questions

References & standards