GitLab CI/CD Generator

Build a .gitlab-ci.yml pipeline config. Pick your stack, configure stages, download the file.

Language / Framework
Version
Pipeline Stages
Deploy Target
Push image to registry (DockerHub, GitLab, GHCR)
Test Services
Options
Runner Tag (optional)
.gitlab-ci.yml68 lines
# =================================================
#  GitLab CI/CD Pipeline — Node.js
#  Generated by DevToolKit (devtoolkit.site)
# =================================================

stages:
  - lint
  - test
  - build
  - deploy

variables:
  DOCKER_IMAGE: "$CI_REGISTRY_IMAGE"
  DOCKER_TAG: "$CI_COMMIT_SHORT_SHA"

image: node:20-alpine

cache:
  key: "$CI_COMMIT_REF_SLUG"
  paths:
    - node_modules/

before_script:
  - npm ci

lint:
  stage: lint
  script:
    - npm run lint

test:
  stage: test
  script:
    - npm test
  coverage: '/Lines\s*:\s*(\d+\.?\d*)%/'

build:
  stage: build
  image: docker:27
  services:
    - docker:27-dind
  variables:
    DOCKER_TLS_CERTDIR: "/certs"
  before_script:
    - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
  script:
    - docker build -t "$DOCKER_IMAGE:$DOCKER_TAG" -t "$DOCKER_IMAGE:latest" .
    - docker push "$DOCKER_IMAGE:$DOCKER_TAG"
    - docker push "$DOCKER_IMAGE:latest"
  rules:
    - if: $CI_COMMIT_BRANCH == "main"

deploy:
  stage: deploy
  image: docker:27
  services:
    - docker:27-dind
  before_script:
    - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
  script:
    - echo "Image pushed in build stage: $DOCKER_IMAGE:$DOCKER_TAG"
    - echo "Deploy to production complete"
  environment:
    name: production
  rules:
    - if: $CI_COMMIT_BRANCH == "main"
      when: manual
lint
test
build
deploy

About GitLab CI/CD Pipeline Configuration

GitLab CI/CD uses a .gitlab-ci.yml file in the root of your repository to define your pipeline. Each pipeline consists of stages (like lint, test, build, deploy) that run in sequence, with jobs in the same stage running in parallel.

Stages define the order of execution. A common pattern is lint → test → build → deploy. If any job in a stage fails, the next stage won't run (unless configured with allow_failure: true). Services like PostgreSQL or Redis can be attached to jobs for integration testing — they run as Docker containers alongside your job.

Caching speeds up pipelines by preserving directories like node_modules or .pip-cache between runs. Artifacts pass files between stages — for example, the build stage produces a binary that the deploy stage uses. Rules control when jobs run: deploy only on the main branch, or require manual approval for production.

This generator creates production-ready pipelines following GitLab CI/CD best practices. It supports Docker-in-Docker builds, multi-environment deployments (staging → production), coverage reporting in merge requests, and JUnit test report integration. All configuration runs in your browser — no data is sent to any server.

Need a complete walkthrough? Read our GitLab CI/CD Pipeline Guide 2026 — pipeline structure, Node.js/Python/Go examples, Docker builds, Kubernetes deployments, and caching strategies.