⚙️ GitHub Actions Workflows
GitHub Actions is Maxi's Computers' primary CI/CD automation platform. Workflows are YAML files stored in .github/workflows/ and run on GitHub-hosted or self-hosted runners in response to repository events.
Workflow Syntax
yaml
## TriggersSecrets & Variables
Use OIDC for AWS Prefer OpenID Connect (OIDC) over long-lived AWS access keys in secrets. OIDC tokens are short-lived and scoped to the specific workflow run.
yaml
## Matrix BuildsDependency Caching
yaml
## Reusable WorkflowsEnvironments & Protection Rules
GitHub Environments add protection gates before jobs can run against protected resources:
- Required reviewers — Designated people must approve before deployment proceeds.
- Wait timer — Delay deployment by N minutes (useful for canary monitoring).
- Deployment branches — Restrict which branches can deploy to an environment.
- Environment secrets — Secrets scoped to a specific environment (e.g., prod DB credentials).
Best Practices
- Pin action versions to a full SHA:
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683prevents supply-chain attacks.
- Set
timeout-minuteson every job to prevent runaway billing.
- Use
permissions: {}at the workflow level and grant only what's needed per job.
- Cache aggressively — Use
actions/cacheor built-in caching in setup actions.
- Fail fast on PRs, not on main — Use
fail-fast: truefor PR checks andfalsefor release pipelines.
- Use
concurrencyto cancel in-progress runs when new commits are pushed to the same branch.