Skip to content

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 ​

  1. Open Gitea and the local runner and run the runner probe.
  2. Use F03 to see independent jobs and a dependent gate, then use G02 to add the calculator's real pytest run.
  3. 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 ​

ChapterWhat it covers
1. Workflow fundamentalsTriggers, jobs, variables, outputs, manual inputs and cancellation
2. Gitea and the local runnerRunner probes, uv, package builds, artifacts, caches and capacity
3. Testing and qualityPython matrix, Ruff, coverage, Postgres, Node, required checks and Terraform
4. Artifacts, cache and reuseWheel handoff, cache keys, reusable workflows, composite actions and checksums
5. Containers and releasesDocker build, running-container smoke test, GHCR, Gitea registry and tagged releases
6. Deployment and rollbackDry-run, staging approval, digest promotion, smoke tests and GitOps
7. Security and supply chainToken scopes, PR data, SBOMs, provenance, OIDC and action pinning
8. Observability and reliabilityRun summaries, time limits, retries, diagnostics and inference latency
9. GitLab CI comparisonStages, workflow rules, cache, artifact dependencies and matrices

3. Copy a snippet ​

PlatformWorkflow 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 ​