gitlab-ci-patterns

Create GitLab CI/CD pipelines with multi-stage workflows, caching, and Kubernetes deployment.

2|Updated Jun 16, 2026
One-click install
npx skills add https://github.com/monang404/lunawave --skill gitlab-ci-patterns-monang404
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: gitlab-ci-patterns
Source: https://github.com/monang404/lunawave/tree/main/.agent/skills/gitlab-ci-patterns
Command: npx skills add https://github.com/monang404/lunawave --skill gitlab-ci-patterns-monang404

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Writing GitLab CI/CD configuration from scratch is error-prone and time-consuming, especially when coordinating multi-stage builds, caching, security scanning, and multi-environment deployments. ## Core Features & Use Cases - Pipeline Templates: Ready-to-adapt YAML patterns for build, test, and deploy stages with artifacts and coverage reporting. - Docker & Kubernetes Deployment: Patterns for building and pushing container images to the GitLab registry and deploying to staging and production with kubectl. - Terraform & Security Scanning: Infrastructure pipelines with validate/plan/apply stages plus SAST, dependency, container, and Trivy scanning. - Use Case: You need to set up CI/CD for a Node.js app that builds Docker images, runs tests with coverage, and deploys to Kubernetes production behind a manual approval gate. ## Quick Start Ask the assistant to generate a GitLab CI pipeline that builds a Docker image, runs tests, and deploys to Kubernetes production with a manual approval step.

Frequently Asked Questions about gitlab-ci-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a GitLab CI pipeline with build, test, and deploy stages?▼

Define stages in the .gitlab-ci.yml file, then create jobs assigned to each stage with script commands. Use artifacts to pass build outputs between stages and cache to persist dependencies like node_modules across pipeline runs.

How to build and push Docker images in GitLab CI?▼

Use the docker image with the docker:dind service, log in with CI_REGISTRY_USER and CI_REGISTRY_PASSWORD variables, then run docker build and docker push targeting the GitLab container registry. Tag images with CI_COMMIT_SHA for traceability.

Does GitLab CI support deploying to Kubernetes?▼

Yes, GitLab CI deploys to Kubernetes using kubectl with cluster credentials stored as CI/CD variables. The patterns show configuring kubeconfig in before_script and running kubectl apply with rollout status checks per environment.

How do I add security scanning to a GitLab pipeline?▼

Include GitLab's built-in templates for SAST, Dependency-Scanning, and Container-Scanning via the include keyword. You can also add custom jobs like Trivy image scanning with severity thresholds and allow_failure controls.

Why is my GitLab CI cache not working between jobs?▼

Caching fails when cache keys differ between jobs or paths are not shared. Use a consistent key like CI_COMMIT_REF_SLUG, verify the paths exist after job scripts run, and check the cache policy setting (pull-push vs pull).

When should I use manual gates in GitLab CI deployments?▼

Use when: manual on production deployment jobs to require human approval before releasing. This prevents accidental production changes while keeping staging deployments fully automated on develop branch merges.