GitLab CI

GitLab CI

Integrated CI/CD pipelines within the GitLab platform

Features

  • Pipeline-as-code with .gitlab-ci.yml
  • Built-in container registry and artifact management
  • Auto DevOps for zero-config CI/CD
  • Parent-child and multi-project pipelines

Pros

  • Deeply integrated with GitLab's complete DevOps platform
  • More powerful pipeline features than GitHub Actions
  • Self-hosted option for full control

Cons

  • Tied to GitLab platform
  • YAML configuration can be verbose
  • Self-hosted runners require maintenance

Overview

GitLab CI/CD is a continuous integration and deployment platform built into GitLab. It provides a comprehensive pipeline system defined through a .gitlab-ci.yml file in your repository root. Pipelines consist of stages and jobs that run on GitLab Runners, which can be shared (hosted by GitLab) or self-hosted.

GitLab CI differentiates itself from GitHub Actions through more advanced pipeline features: directed acyclic graph (DAG) pipelines for optimized job scheduling, parent-child pipelines for modular configuration, and multi-project pipelines for coordinating across repositories.

The Auto DevOps feature can automatically detect your project’s language, build it, run tests, perform security scans, and deploy to Kubernetes with zero configuration, lowering the barrier to CI/CD adoption.

When to Use

Choose GitLab CI when your code is hosted on GitLab, or when you need advanced pipeline features like DAG scheduling, multi-project pipelines, or the integrated security scanning suite.

Getting Started

# .gitlab-ci.yml
stages:
  - test
  - build

test:
  stage: test
  image: node:20
  script:
    - npm ci
    - npm test

build:
  stage: build
  script:
    - npm run build