DevOps by Patrik

Including Shared GitLab CI YAML Files

GitLab allows you to include .gitlab-ci.yml files from other repositories. This is a powerful way to reuse pipeline templates across projects.

How it works:

include:
  - project: 'your-group/ci-templates'
    ref: 'main'
    file: '/CI/jobs.yml'

Limitations:

  • Only works with YAML files (not PowerShell, XML, etc.)
  • Files must be structured as valid GitLab CI YAML

Best for: Reusing standard pipeline jobs or templates.

gitlab
yaml
pipeline
templates
include

Comments