Skip to content

GitLab CI/CD: Introduction & Getting Started

GitLab CI/CD is a built-in continuous integration and delivery system in GitLab, enabling you to automate builds, tests, and deployments directly from your Git repository.

Why Use GitLab CI/CD?

  • Automate testing and deployment with every commit
  • Define pipelines as code in .gitlab-ci.yml
  • Integrate with Docker, Kubernetes, and cloud providers

How GitLab CI/CD Works

  • Pipelines are triggered by changes in your repository
  • Jobs and stages are defined in .gitlab-ci.yml
  • Runners execute jobs on your infrastructure or in the cloud

Quick Start Example

  1. Create a .gitlab-ci.yml in your repo:
    stages:
      - build
      - test
    
    build-job:
      stage: build
      script:
        - echo "Building..."
    
    test-job:
      stage: test
      script:
        - echo "Running tests..."
    
  2. Push to GitLab:
  3. The pipeline runs automatically on push
  4. View pipeline status:
  5. Go to your project’s CI/CD > Pipelines page

Learn More