CI/CD Pipelines: Monorepos, Templates, and Maintainability

Selective execution, shared scripts, naming, and maintainable organization for growing automation estates.

View
StandardDetailedCompact
Export
Copy the compact sheet, download it, or print it.
Download
`D` dense toggle · `C` copy all
## Avoid running everything on every change
GitHub path filters
on:
  push:
    paths:
      - 'apps/web/**'
      - 'packages/ui/**'
      - '.github/workflows/web.yml' 

# Run workflows only when selected folders change.

GitLab rules with changes
web_test:
  stage: test
  rules:
    - changes:
        - apps/web/**/*
        - packages/ui/**/*

# Conditionally run jobs based on file changes.

Generate jobs per package
strategy:
  matrix:
    package: [api, web, worker]

# Drive job fan-out from changed package lists or matrix inputs.

## Make pipelines maintainable
Wrap repeated commands in repo scripts
./scripts/ci/install.sh
./scripts/ci/test.sh
./scripts/ci/build.sh

# Keep YAML small by moving logic into versioned scripts.

Use predictable workflow names
ci-web.yml
ci-api.yml
deploy-production.yml
nightly-maintenance.yml

# Name workflows by concern or application area.

Expose pipeline health publicly
![CI](https://github.com/acme/project/actions/workflows/ci.yml/badge.svg)

# Add workflow status badges to docs or README files.

Recommended next

No recommendations yet.