CI/CD Snippet Library
CI/CD Engineering Encyclopedia · Browse eight volumes, 500 snippets, 60 workflows, 100 failure labs, 100 configuration examples and 30 design patterns.
A Markdown reference for writing, debugging and extending pipelines with Gitea Actions, GitHub Actions and GitLab CI. It expands the six templates in Advanced CI/CD Pipeline Templates into 56 indexed snippets, a lab progression and an end-to-end Python service capstone.
1. Start here
- Open Gitea and the local runner and run the runner probe.
- Use F03 to see independent jobs and a dependent gate, then use G02 to add the calculator's real pytest run.
- Follow the lab sequence to test one change at a time, or use the full index to jump to a specific pattern.
2. Browse by topic
| Chapter | What it covers |
|---|---|
| 1. Workflow fundamentals | Triggers, jobs, variables, outputs, manual inputs and cancellation |
| 2. Gitea and the local runner | Runner probes, uv, package builds, artifacts, caches and capacity |
| 3. Testing and quality | Python matrix, Ruff, coverage, Postgres, Node, required checks and Terraform |
| 4. Artifacts, cache and reuse | Wheel handoff, cache keys, reusable workflows, composite actions and checksums |
| 5. Containers and releases | Docker build, running-container smoke test, GHCR, Gitea registry and tagged releases |
| 6. Deployment and rollback | Dry-run, staging approval, digest promotion, smoke tests and GitOps |
| 7. Security and supply chain | Token scopes, PR data, SBOMs, provenance, OIDC and action pinning |
| 8. Observability and reliability | Run summaries, time limits, retries, diagnostics and inference latency |
| 9. GitLab CI comparison | Stages, workflow rules, cache, artifact dependencies and matrices |
3. Copy a snippet
| Platform | Workflow location in the target repository |
|---|---|
| Gitea Actions | .gitea/workflows/<name>.yml |
| GitHub Actions | .github/workflows/<name>.yml |
| GitLab CI | .gitlab-ci.yml |
Start with a full workflow. A fragment goes into the scope named in its description. Each example identifies the platform, files or settings it assumes, and a result to check. Replace example values and verify the branch name and runner label before pushing. The examples use Markdown with fenced YAML and scripts. The encyclopedia also includes a JSON catalog and a Python search command.
4. Practice and reference
- Capstone · Python service pipeline walks through Gitea checks, Docker smoke tests, GHCR publishing, Kubernetes staging and rollback.
- Lab sequence gives predictions, deliberate failures and evidence to save.
- Compatibility guide maps portability between platforms and identifies where installation or plan details matter.
- Troubleshooting starts with the earliest failing layer.
- Sources and reference mapping shows where the six starting templates landed and links to platform documentation.