github-actions-builder
GitHub Actions Builder
Overview
Author production-grade GitHub Actions workflows that are fast, deterministic, and secure by default.
Keywords: github actions, workflow, ci, cd, ci/cd, .github/workflows, jobs, steps, runs-on, matrix, build matrix, strategy, fail-fast, cache, actions/cache, setup-node, setup-python, setup-go, secrets, GITHUB_TOKEN, permissions, OIDC, environments, reusable workflow, workflow_call, composite action, concurrency, artifacts, upload-artifact, deploy, release, pinning SHA, dependabot.
This skill covers the full lifecycle: choosing triggers, structuring jobs, caching dependencies correctly, fanning out across a matrix, passing secrets safely, gating deployments with environments, and factoring shared logic into reusable or composite workflows. Always prefer the patterns and pinning rules in references/best-practices.md and validate output structure with scripts/validate_workflow.py.
Workflow
-
Clarify intent. Identify: project language/runtime, the events that should trigger CI (push, pull_request, tag, schedule, manual), and whether deployment is in scope. If the user only says "add CI", default to lint + test on
pushto the default branch and onpull_request. -
Pick triggers (
on:). Usepull_requestfor validation andpush(filtered to the default branch) to avoid double-runs on PR branches. Addworkflow_dispatchfor manual runs andtagsfilters for release pipelines. See the trigger matrix inreferences/best-practices.md. -
Set top-level defaults. Always add
permissions:(least privilege, defaultcontents: read) andconcurrency:to cancel superseded runs. Pin a sensibletimeout-minuteson every job. -
Structure jobs. Split lint, test, and build/deploy into separate jobs so failures are isolated and parallel. Use
needs:to express ordering. Gate deploy jobs onif: github.ref == 'refs/heads/main' && github.event_name == 'push'.