
Gitlab Ci Pipeline Configuration
- 1 installs
- 186 repo stars
- Updated July 19, 2026
- thebushidocollective/han
Configure GitLab CI/CD pipelines, define stages, and set up workflow rules governing stage ordering and execution flow.
About
Covers configuring GitLab CI/CD pipelines including stages, workflow rules, and execution flow. A developer uses it when structuring the overall pipeline for a GitLab project.
- Pipeline stages and stage ordering
- Workflow rules and execution flow
Gitlab Ci Pipeline Configuration by the numbers
- 1 all-time installs (skills.sh)
- Ranked #1,173 of 1,435 DevOps & CI/CD skills by installs in the Skillselion catalog
- Data as of Aug 1, 2026 (Skillselion catalog sync)
npx skills add https://github.com/thebushidocollective/han --skill gitlab-ci-pipeline-configurationAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 1 |
|---|---|
| repo stars | ★ 186 |
| Last updated | July 19, 2026 |
| Repository | thebushidocollective/han ↗ |
What it does
Configure GitLab CI/CD pipelines, define stages, and set up workflow rules governing stage ordering and execution flow.
Files
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_BRANCHStage Configuration
Sequential Stages
stages:
- install
- lint
- test
- build
- deployParallel 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:e2eWorkflow 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_TAGAuto-Cancel Redundant Pipelines
workflow:
auto_cancel:
on_new_commit: interruptibleUsing 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 deployInclude 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.ymlBest Practices
1. Define clear stage ordering 2. Use needs to optimize pipeline execution 3. Configure workflow rules to prevent unnecessary pipelines 4. Use include to split large configurations 5. Set appropriate interruptible flags for cancelable jobs