gitlab-ci-pipeline-configuration

GitLab CI - Pipeline Configuration

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "gitlab-ci-pipeline-configuration" with this command: npx skills add thebushidocollective/han/thebushidocollective-han-gitlab-ci-pipeline-configuration

GitLab CI - Pipeline Configuration

Configure GitLab CI/CD pipelines with proper stage ordering, workflow rules, and execution flow.

Pipeline Structure

.gitlab-ci.yml

stages:

  • build
  • test
  • deploy

default: image: node:20-alpine before_script: - npm ci --cache .npm --prefer-offline cache: key: ${CI_COMMIT_REF_SLUG} paths: - .npm/

workflow: rules: - if: $CI_PIPELINE_SOURCE == "merge_request_event" - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH

Stage Configuration

Sequential Stages

stages:

  • install
  • lint
  • test
  • build
  • deploy

Parallel Jobs Within Stages

test:unit: stage: test script: npm run test:unit

test:integration: stage: test script: npm run test:integration

test:e2e: stage: test script: npm run test:e2e

Workflow Rules

Branch-Based Pipelines

workflow: rules: - if: $CI_COMMIT_BRANCH == "main" variables: DEPLOY_ENV: production - if: $CI_COMMIT_BRANCH =~ /^release// variables: DEPLOY_ENV: staging - if: $CI_PIPELINE_SOURCE == "merge_request_event" - if: $CI_COMMIT_TAG

Auto-Cancel Redundant Pipelines

workflow: auto_cancel: on_new_commit: interruptible

Using Needs for DAG Pipelines

build: stage: build script: npm run build

test:unit: stage: test needs: ["build"] script: npm run test:unit

test:lint: stage: test needs: [] # No dependencies, runs immediately script: npm run lint

deploy: stage: deploy needs: ["build", "test:unit"] script: npm run deploy

Include External Configurations

include:

  • local: .gitlab/ci/build.yml
  • local: .gitlab/ci/test.yml
  • project: 'my-group/my-templates' ref: main file: '/templates/deploy.yml'
  • template: Security/SAST.gitlab-ci.yml

Best Practices

  • Define clear stage ordering

  • Use needs to optimize pipeline execution

  • Configure workflow rules to prevent unnecessary pipelines

  • Use include to split large configurations

  • Set appropriate interruptible flags for cancelable jobs

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

android-jetpack-compose

No summary provided by upstream source.

Repository SourceNeeds Review
General

fastapi-async-patterns

No summary provided by upstream source.

Repository SourceNeeds Review
General

storybook-story-writing

No summary provided by upstream source.

Repository SourceNeeds Review
General

atomic-design-fundamentals

No summary provided by upstream source.

Repository SourceNeeds Review