This repository's GitHub Actions workflows are designed to be copied into template repositories.
- Python reusable jobs (
.github/workflows/python-*.yml) - Optional frontend reusable jobs for React/JavaScript (
.github/workflows/frontend-*.yml) - Reusable Docker build/push job (
.github/workflows/build-and-push.yml) - Main orchestrator (
.github/workflows/ci.yml) with stack auto-detection and release support
ci.yml supports repository variables (Settings -> Secrets and variables -> Actions -> Variables) so you can reuse workflows without editing YAML in every repo.
Set any of these optional variables:
CI_PYTHON_VERSION(default:3.12)CI_PYTHON_TEST_VERSIONS(default:["3.11","3.12","3.13"])CI_PYTHON_INSTALL_SPEC(default:.[dev])CI_PYTHON_COMPILE_FILES(default: empty)CI_PYTHON_COVERAGE_TARGET(default: empty)CI_PYTHON_COVERAGE_THRESHOLD(default:85)CI_FRONTEND_NODE_VERSION(default:22)CI_FRONTEND_WORKDIR(default:frontend)
GITLEAKS_LICENSEis optional. If not set, the gitleaks step still runs with default behavior.
The CI workflow detects project components and only runs relevant jobs:
- Python jobs run if
pyproject.toml,setup.py, orrequirements.txtexists. - Frontend jobs run if
${CI_FRONTEND_WORKDIR}/package.jsonexists. - Frontend E2E runs only when frontend exists, Python exists, and a Playwright config exists in frontend workdir.
- Docker jobs run only when
Dockerfileexists.
docker-buildruns on pull requests (build only, no push).docker-pushruns on:- push to
main - tag push matching
v* - release published
- push to
- GitHub release job runs on
v*tag pushes after quality gate and Docker push succeed.
- Copy
.github/workflows/*into the template repository. - Configure repo variables listed above (only if defaults do not fit).
- Add optional secrets (for example
GITLEAKS_LICENSE) as needed. - Ensure your repo uses expected conventions:
- Python package config at root.
- Frontend at
frontend/(or override withCI_FRONTEND_WORKDIR). Dockerfileat root for Docker jobs.
The deploy workflows in .github/workflows/deploy-staging.yml and .github/workflows/deploy-production.yml are template-ready and derive naming from repo/org by default.
- Staging namespace:
<org-prefix>-staging(example:graphras-staging) - Production namespace:
<org-prefix>-prod(example:graphras-prod) - Container image:
ghcr.io/<org-ghcr>/<app-name>:<tag> - Staging host:
staging-<app-name>.<org-dns> - Production host:
<app-name>.<org-dns> - Staging deploy image tag:
staging(published onmainpushes) - Production deploy image tag: release tag (e.g.
1.2.3fromv1.2.3)
Trigger behavior:
- Staging deploy runs via
workflow_callfromci.ymlafterdocker-pushsucceeds onmain, or viaworkflow_dispatch(manual). - Production deploy runs via
workflow_callfromci.ymlafterdocker-pushsucceeds on av*tag push, or viaworkflow_dispatch. - All deploy secrets are configured in GitHub Actions environments (
stagingandproduction).
Optional environment variable overrides (set in GitHub Actions environment secrets):
APP_NAME(default: repository name)ORG_GHCR(default: GitHub org slug, e.g.graphras-com)ORG_DNS(default heuristic fromORG_GHCR, e.g.graphras.com)ORG_NS(default:ORG_GHCRstripped of common TLD suffixes, e.g.graphras)
This split handles GitHub org slug vs DNS domain naming (for example graphras-com -> graphras.com).