# CI CD Pipeline

> Use when setting up or improving CI/CD pipelines - GitHub Actions, automated testing, deployment, release automation

- Skill: `tomevault-io/ci-cd-pipeline-11` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add tomevault-io/ci-cd-pipeline-11`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tomevault-io/ci-cd-pipeline-11/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: DevOps & Infra
- Author: tomevault-io (https://skillmd.com/u/tomevault-io)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/tomevault-io/ci-cd-pipeline-11

---


# CI/CD Pipeline

## Overview

Automate everything between code push and production deployment. A good pipeline catches bugs early and deploys confidently.

## When to Use

- Setting up CI/CD for a new project
- Adding automated tests to pipeline
- Improving deployment speed or reliability
- Implementing release automation

## Pipeline Stages

```
Push → Lint → Test → Build → Security Scan → Deploy Staging → Deploy Production
```

### Minimum Viable Pipeline
1. **Lint** — catch style/syntax issues instantly
2. **Test** — unit + integration tests
3. **Build** — verify it compiles/bundles
4. **Deploy** — automated to staging, gated to production

## GitHub Actions Template

```yaml
name: CI
on: [push, pull_request]
jobs:
  ci:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4  # or setup-python, etc.
      - run: npm ci
      - run: npm run lint
      - run: npm test
      - run: npm run build
```

## Best Practices

- **Fast feedback** — lint and unit tests should finish in <2 minutes
- **Fail fast** — run cheapest checks first (lint before test before build)
- **Cache dependencies** — `actions/cache` for node_modules, pip cache, etc.
- **Branch protection** — require CI pass before merge
- **Environment secrets** — never hardcode, use GitHub Secrets / Vault
- **Parallel jobs** — split test suites across runners
- **Artifact storage** — save build outputs for deployment stage

## Deployment Strategies

| Strategy | Risk | Rollback | Use When |
|----------|------|----------|----------|
| Rolling | Low | Slow | Default for most apps |
| Blue/Green | Low | Instant | Need instant rollback |
| Canary | Lowest | Fast | High-traffic production |
| Recreate | High | Slow | Dev/staging only |

## Checklist

- [ ] All tests run in CI (not just locally)
- [ ] Pipeline fails on lint errors
- [ ] Secrets stored securely (not in code)
- [ ] Deploy to staging automatically on merge to main
- [ ] Production deploy requires approval or tag
- [ ] Pipeline runs in <10 minutes

## Integration

- **magic-powers:finishing-a-development-branch** — merge workflow that triggers CI
- **magic-powers:docker-containerization** — build container images in CI
- **magic-powers:security-review** — add security scanning to pipeline

---
> Source: [kienbui1995/magic-powers](https://github.com/kienbui1995/magic-powers) — distributed by [TomeVault](https://tomevault.io).
<!-- tomevault:4.0:skill_md:2026-06-15 -->

