Gitlab Cicd Pipeline

aj-geddes/useful-ai-prompts/skills/gitlab-cicd-pipeline

by aj-geddes3f5182cfd739No license355 starsListed Oct 8, 2026Updated Oct 8, 2026Repository updated 7 months ago

Design and implement GitLab CI/CD pipelines with stages, jobs, artifacts, and caching. Configure runners, Docker integration, and deployment strategies.

Includes scriptsDevOps & Cloud
AI-generated overview

Designs GitLab CI/CD pipelines with stages, jobs, caching, runners, Docker and Kubernetes deployment.

What it does
Provides guidance and reference material for building GitLab CI/CD pipelines, covering stages, jobs, artifacts, caching, runner configuration, Docker layer caching, multi-project pipelines and Kubernetes deployment. It includes a minimal .gitlab-ci.yml example, a pipeline template, and a validation script. The deliverable is pipeline configuration and deployment setup rather than application code.
When to use it
Use it when setting up or improving CI/CD for a GitLab repository, including multi-stage builds, Docker registry integration, review app or Kubernetes deployment, and cache optimization.
Requirements
GitLab repository with CI/CD and GitLab Runner infrastructure; Docker and Kubernetes access for container and deployment steps. Ships an executable validation script and a pipeline template.

GitLab CI/CD Pipeline

Table of Contents

Overview

Create comprehensive GitLab CI/CD pipelines that automate building, testing, and deployment using GitLab Runner infrastructure and container execution.

When to Use

  • GitLab repository CI/CD setup
  • Multi-stage build pipelines
  • Docker registry integration
  • Kubernetes deployment
  • Review app deployment
  • Cache optimization
  • Dependency management

Quick Start

Minimal working example:

yaml
# .gitlab-ci.ymlimage: node:18-alpine
variables:  DOCKER_DRIVER: overlay2  FF_USE_FASTZIP: "true"
stages:  - lint  - test  - build  - security  - deploy-review  - deploy-prod
cache:  key: ${CI_COMMIT_REF_SLUG}  paths:    - node_modules/    - .npm/
lint:  stage: lint  script:    - npm install// ... (see reference guides for full implementation)

Reference Guides

Detailed implementations in the references/ directory:

GuideContents
Complete Pipeline Configuration [blocked]Complete Pipeline Configuration
GitLab Runner Configuration [blocked]GitLab Runner Configuration
Docker Layer Caching Optimization [blocked]Docker Layer Caching Optimization
Multi-Project Pipeline [blocked]Multi-Project Pipeline
Kubernetes Deployment [blocked]Kubernetes Deployment, Performance Testing Stage, Release Pipeline with Semantic Versioning

Best Practices

✅ DO

  • Use stages to organize pipeline flow
  • Implement caching for dependencies
  • Use artifacts for test reports
  • Set appropriate cache keys
  • Implement conditional execution with only and except
  • Use needs: for job dependencies
  • Clean up artifacts with expire_in
  • Use Docker for consistent environments
  • Implement security scanning stages
  • Set resource limits for jobs
  • Use merge request pipelines

❌ DON'T

  • Run tests serially when parallelizable
  • Cache everything unnecessarily
  • Leave large artifacts indefinitely
  • Store secrets in configuration files
  • Run privileged Docker without necessity
  • Skip security scanning
  • Ignore pipeline failures
  • Use only: [main] without proper controls

Source and attribution

Source:aj-geddes/useful-ai-promptsinskills/gitlab-cicd-pipelineat commit3f5182c

License: No license

Content belongs to its original authors. SourceWeft indexes it from a public repository.

Report or request removal