gitlab-ci-patterns

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

Updated Apr 23, 2026
One-click install
npx skills add https://github.com/SanketAdlak/PDMProjectDesign --skill gitlab-ci-patterns-sanketadlak
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gitlab-ci-patterns
Source: https://github.com/SanketAdlak/PDMProjectDesign/tree/main/.agents/skills/gitlab-ci-patterns
Command: npx skills add https://github.com/SanketAdlak/PDMProjectDesign --skill gitlab-ci-patterns-sanketadlak

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, coverage reports, and caching strategies. - Deployment Patterns: Docker image builds with registry pushes, Kubernetes deployments to staging and production, and Terraform validate/plan/apply workflows. - Advanced Automation: Security scanning with SAST and Trivy, dynamic child pipelines, and manual approval gates for production releases. - Use Case: You need to set up CI/CD for a Node.js app that builds a Docker image, runs tests with coverage, and deploys to Kubernetes production only after manual approval—this Skill provides the complete .gitlab-ci.yml structure. ## Quick Start Ask the AI to generate a GitLab CI pipeline that builds a Docker image, runs tests, and deploys to Kubernetes with a manual production gate.

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/CD pipeline with multiple stages?

Define stages like build, test, and deploy in the stages block, then assign each job to a stage with the stage keyword. Jobs in the same stage run in parallel, and later stages only start after earlier ones succeed.

How to deploy to Kubernetes from GitLab CI?

Use a kubectl image like bitnami/kubectl, configure cluster access with KUBE_URL and KUBE_TOKEN CI/CD variables, then run kubectl apply in the deploy job. Add environment blocks to track deployments and use when: manual for production gates.

Does GitLab CI support caching node_modules between jobs?

Yes, use the cache keyword with a key like ${CI_COMMIT_REF_SLUG} and paths pointing to node_modules/. The pull-push policy restores the cache before the job and updates it afterward, speeding up npm ci runs.

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. For container images, add a Trivy job that scans the built image and fails on HIGH or CRITICAL vulnerabilities.

Why is my GitLab production deployment running automatically?

Jobs deploy automatically unless gated. Add when: manual to the production job so it requires a button click in the GitLab UI, and restrict it with only: main so it only appears on the main branch.