home / skills / partme-ai / full-stack-skills / gitlab-ci

gitlab-ci skill

/skills/gitlab-ci

This skill helps you design and automate GitLab CI/CD pipelines, configure jobs and runners, and streamline GitLab workflows.

npx playbooks add skill partme-ai/full-stack-skills --skill gitlab-ci

Review the files below or copy the command above to add this skill to your agents.

Files (2)
SKILL.md
656 B
---
name: gitlab-ci
description: Provides comprehensive guidance for GitLab CI/CD including pipeline configuration, jobs, stages, and GitLab Runner. Use when the user asks about GitLab CI, needs to create CI/CD pipelines, configure GitLab CI jobs, or automate GitLab workflows.
license: Complete terms in LICENSE.txt
---

## When to use this skill

Use this skill whenever the user wants to:
- [待完善:根据具体工具添加使用场景]

## How to use this skill

[待完善:根据具体工具添加使用指南]

## Best Practices

[待完善:根据具体工具添加最佳实践]

## Keywords

[待完善:根据具体工具添加关键词]

Overview

This skill provides comprehensive guidance for GitLab CI/CD focused on pipeline configuration, job definitions, stages, and GitLab Runner setup. It helps you design reliable, maintainable pipelines and automate build, test, and deploy workflows. The content targets practical examples, YAML patterns, and troubleshooting tips for real projects.

How this skill works

The skill inspects common CI requirements and recommends GitLab CI patterns: pipeline structure, job templates, artifacts, caches, and environment variables. It explains how to write .gitlab-ci.yml, configure runners (shared, group, or specific), and secure credentials. You get step-by-step guidance for common tasks like parallel builds, matrix jobs, manual and scheduled pipelines, and deployment strategies.

When to use it

  • Creating a new GitLab CI pipeline for build/test/deploy
  • Migrating existing CI from another system to GitLab CI
  • Configuring GitLab Runner (Docker, shell, or Kubernetes)
  • Optimizing pipeline speed with caching, artifacts, and parallel jobs
  • Implementing environment-based deployment (staging, production)

Best practices

  • Keep .gitlab-ci.yml modular: use includes, anchors, and reusable templates
  • Cache dependencies and use artifacts only when needed to reduce pipeline time and storage
  • Use protected variables and masked secrets for credentials and deploy keys
  • Limit job concurrency and use resource tags for runner-specific workloads
  • Define stages clearly (build, test, deploy) and fail fast with short feedback loops

Example use cases

  • Simple pipeline that installs dependencies, runs unit tests, and builds an artifact
  • Parallel test matrix across multiple Python versions using parallel:matrix or needs/strategy
  • Containerized CI using Docker executor and image: python:3.x with cached pip wheels
  • Deploy to Kubernetes or a VM using environment and protected deploy jobs
  • Scheduled pipeline that runs nightly security scans and dependency updates

FAQ

How do I speed up slow pipelines?

Cache dependencies, reuse Docker layers with custom images, run tests in parallel, and avoid unnecessary artifacts. Use pipeline metrics to find bottlenecks.

When should I use shared runners vs dedicated runners?

Use shared runners for convenience and small projects. Use dedicated/group runners for consistent environments, heavy workloads, or when you need specific hardware or network access.

How can I protect secrets in CI?

Store secrets in GitLab CI/CD variables, mark them as protected/masked, restrict them to protected branches or tags, and avoid printing them in logs.