github-actions-cicd
Skill4 starsChanged 5 months agoMITView on GitHub
GitHub Actions CI/CD patterns for Python services — Poetry caching, SonarQube scanner, semantic versioning, conventional commits, workflow concurrency, path filters, reusable workflows. Platform-neutral GHA syntax layered on top of cloud-cicd skills (gcp-cicd-patterns, aws-cicd-patterns) which cover deployment patterns. Use for PR validation, quality gates, automated release tagging, and migrating to OIDC.
- Reads credentials
4 other projects use a version of this.
Adopted by
Most recently taken up by
- NicoGenti/opencode-orchestrator-kittheir own version, first seen Nov 8, 2026
- jenreh/appkittheir own version, first seen Jul 8, 2026
- julweber/ai_agent_skillstheir own version, first seen Mar 20, 2026
- Kubementat/ai_agent_skillstheir own version, first seen Mar 20, 2026
Other versions4 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 4
- NicoGenti/opencode-orchestrator-kit★ 9same name
- jenreh/appkit★ 4same name
- julweber/ai_agent_skills★ 2same name
- Kubementat/ai_agent_skills★ 2same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository101 other files it gives its agents.
- ai-video-understandingSkill
- apple-foundation-modelsSkill
- arch-dddSkill
- arch-decision-recordsSkill
- arch-diagramsSkill
- arch-eventsSkill
- arch-mvp-roadmapSkill
- arch-python-modernSkill
- aws-app-runnerSkill
- aws-cicd-patternsSkill
- aws-security-hardeningSkill
- azure-functions-python-v2Skill
- azure-identity-m2m-authSkill
- azure-service-bus-messagingSkill
- azure-workflow-execution-modelsSkill
- caddy-tls-proxySkill
- compliance-frameworksSkill
- design-system-workflowSkill
- dev-debugging-strategiesSkill
- dev-standardsSkill
- docker-python-poetrySkill
- docker-pythonSkill
- fastapi-patternsSkill
- ffmpeg-laravel-videoSkill
- formik-yup-react-nativeSkill
- frontend-accessibilitySkill
- frontend-angular-aiSkill
- frontend-angularSkill
- frontend-angular-toolingSkill
- frontend-design-systemsSkill
- frontend-material-chatSkill
- frontend-material-design-3Skill
- frontend-svelteSkill
- gcp-cicd-patternsSkill
- gcp-cloud-runSkill
- gcp-cloudsql-infrastructureSkill
- gcp-finopsSkill
- gcp-observabilitySkill
- gcp-security-hardeningSkill
- healthkit-biofeedbackSkill
- infra-terraformSkill
- ios-app-qualitySkill
- ios-audio-hapticsSkill
- jest-nestjs-testingSkill
- langchain-azure-openai-patternsSkill
- laravel-auth-hardeningSkill
- laravel-ci-mysqlSkill
- laravel-mix-webpackSkill
- laravel-modern-patternsSkill
- laravel-pint-patternsSkill
- laravel-s3-storageSkill
- laravel-sail-dockerSkill
- mobile-app-deploymentSkill
- mobile-e2e-testingSkill
- mobile-offline-syncSkill
- mobile-push-notificationsSkill
- mobile-video-uploadSkill
- mongodb-asyncmongoclient-patternsSkill
- mongodb-atlas-patternsSkill
- nestjs-patternsSkill
- The first 60 shown.
The file
Files
GitHub Actions CI/CD for Python
GitHub Actions–specific syntax and Python tooling integrations. Platform-neutral; deployment patterns for specific clouds live in gcp-cicd-patterns / aws-cicd-patterns.
When to use
- Designing a Python QA pipeline (Ruff → pytest → SonarQube → build → release)
- Adding Poetry caching to a workflow
- Integrating SonarQube / SonarCloud quality gate
- Automating semantic versioning from conventional commits
- Adding workflow concurrency to kill stale PR runs
- Migrating from
AZURE_CLIENT_SECRET/ long-lived tokens to OIDC
For cloud-deployment patterns (OIDC for GCP/AWS, Cloud Run / App Runner deploys, environment promotion), see gcp-cicd-patterns and aws-cicd-patterns. Conventional Commits format (feat / fix / perf / BREAKING CHANGE+!) maps to SemVer increments (MINOR / PATCH / PATCH / MAJOR); python-semantic-release parses commit history to compute the next version.
Core patterns
| Pattern | One-line rule |
| Poetry cache | snok/install-poetry@v1 + actions/cache@v4 keyed on poetry.lock hash. actions/setup-python cache: 'poetry' has chicken-and-egg issues. |
| Path filters | paths: on pull_request skips runs for doc-only changes |
| Concurrency | concurrency: { group: ${{ github.workflow }}-${{ github.ref }}, cancel-in-progress: true } — kill stale PR runs |
| Conditional cancel | On main, set cancel-in-progress: ${{ !contains(github.ref, 'main') }} to never cancel release jobs |
fetch-depth: 0 | Required for SonarQube blame and python-semantic-release (default 1 breaks both) |
| SonarQube action | SonarSource/sonarqube-scan-action@v7 (Java 21 embedded JRE). v6→v7 broke args syntax. |
| python-semantic-release | Use over Node-based semantic-release. Stamps pyproject.toml natively, no Node runtime. |
| Reusable workflows | uses: org/repo/.github/workflows/x.yaml@main — DRY for org-wide CI patterns |
| OIDC for cloud auth | permissions: { id-token: write } + actions/azure/login@v2 (no client_secret) |
Quick reference
Poetry cache + install
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true # deterministic .venv path
- uses: actions/cache@v4
with:
path: .venv
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
restore-keys: ${{ runner.os }}-poetry-
- run: poetry install --no-interaction --no-rootSonarQube quality gate
- run: poetry run pytest --cov --cov-report=xml
- uses: SonarSource/sonarqube-scan-action@v7
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- uses: SonarSource/sonarqube-quality-gate-action@v1
timeout-minutes: 5
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}sonar-project.properties at repo root:
sonar.organization=<org-key>
sonar.projectKey=<project-key>
sonar.sources=app
sonar.tests=tests/
sonar.test.exclusions=tests/**
sonar.python.coverage.reportPaths=coverage.xmlMandatory: actions/checkout@v4 with fetch-depth: 0.
Concurrency + path filters
on:
pull_request:
types: [opened, synchronize, reopened]
paths:
- "app/**"
- "tests/**"
- "pyproject.toml"
- "poetry.lock"
workflow_dispatch: {}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ !contains(github.ref, 'refs/heads/main') }}PHP / Laravel Multi-Job CI
Parallel lint + test jobs with all configuration injected via the workflow env: block — no .env bootstrap, no php artisan key:generate. Mirrors a pattern used across 4+ AIEE Laravel backend services.
env:
APP_KEY: base64:AAAA... # static, not generated at runtime
APP_ENV: testing
DB_CONNECTION: mysql
DB_HOST: 127.0.0.1
DB_DATABASE: testing
DB_USERNAME: root
DB_PASSWORD: root
services:
mysql:
image: mysql:8
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: testing
options: >-
--health-cmd="mysqladmin ping -h localhost -u root -proot"
--health-interval=10s
--health-retries=10When MySQL service is mandatory: any migration that calls $table->dropForeign([...]) inside up() (not just down()) crashes SQLite :memory: with BadMethodCallException. Run grep -r 'dropForeign' database/migrations/ before defaulting to SQLite.
Justfile pattern: CI inlines underlying tool commands (e.g., vendor/bin/pint --test); the justfile provides local-dev parity via just lint. Keeps CI logs clean, removes a just-install step from runners.
| Anti-Pattern | Pattern |
vendor/bin/pint --test --dirty in CI | --dirty checks files differing from HEAD in the working tree; CI checkouts have no unstaged changes, so diff is always empty — lint gate silently disabled. Use pint --test (full tree) |
cp .env.example .env || true + artisan key:generate | .env.example is often absent or gitignored; inject APP_KEY directly via workflow env: |
Empty ${{ secrets.X }} substituted into a CLI flag | Produces cryptic argument-parsing errors (e.g., option requires an argument -- p). Run gh secret list to verify secrets are populated before debugging the command |
Anti-patterns (top 4)
- Secrets in workflow YAML → use
${{ secrets.X }}only; OIDC for cloud auth - No concurrency block → stale and fresh runs race; flaky results, wasted minutes
- No
paths:filter → README edits trigger full lint + test + Sonar scan fetch-depth: 1(default) on Sonar/release jobs → SonarQube blame fails;python-semantic-releasecan't find prior tags
npm Publish Troubleshooting
E404 … PUTon an existing scoped package is an auth failure, not a missing package. npm returns a misleading 404 for what is usually an expired or revoked token. Rotate the token secret, then re-run only the failed job in place withgh run rerun <id> --repo R --failed(the artifact must still be within retention).- Admin-merge gates on CI, not review.
gh pr merge --adminbypasses required review but not CI — confirmgh pr checksare green first. Bypass review, never a red build.
Important notes
SonarSource/sonarqube-scan-action@v7breaking change from v6: theargsoption no longer supports full bash syntax (command injection prevention). Multi-value parameters must be newline-separated, not semicolon-separated.actions/setup-python@v5'scache: 'poetry'has a chicken-and-egg issue — it needs Poetry already installed to readpoetry.lockfor the cache key. Thesnok/install-poetry@v1+ manualactions/cache@v4pattern works around this.- GHA concurrency queue depth is 1 — group allows at most one running + one pending. A third push cancels the pending, not the running.
See reference.md for the full pattern catalogue, examples.md for the project's reusable-workflow architecture and a standalone-pipeline alternative.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

