The Story
Follow the narrative to build a mental model of how everything connects.
The Spark
Every automation begins with a trigger. A developer pushes code, opens a pull request, or a cron schedule fires at midnight UTC. GitHub detects the event and searches .github/workflows/ for any YAML file whose ‘on’ key matches. The workflow ignites.
The Blueprint
The workflow YAML is the blueprint. It declares which events trigger it, what permissions it needs, and how jobs are organised. Concurrency groups prevent wasteful duplicate runs. Defaults set the shell and working directory for every step.
The Assembly Line
Jobs are the assembly stations. They run in parallel by default, but ‘needs’ creates a dependency chain: build → test → deploy. Each job gets a fresh runner — nothing carries over unless you explicitly share artifacts. Matrix strategies multiply jobs across OS, Node versions, or any custom axis.
The Workbench
Inside each job, steps execute one by one. A step either ‘uses’ a pre-built action or ‘run’s shell commands. The first step is almost always actions/checkout to clone the repository. Each step can set outputs that later steps and jobs consume via the steps context.
The Toolbox
Actions are the reusable tools. JavaScript actions run fastest on any OS. Docker actions package complex dependencies but only work on Linux. Composite actions stitch multiple steps into one shareable unit. The Marketplace hosts thousands of community actions, but enterprise teams curate allow-lists.
The Vault
Secrets never appear in logs — GitHub masks them automatically. Repository secrets serve one repo, organisation secrets span many, and environment secrets scope to deployment targets. For cloud deployments, OIDC eliminates long-lived credentials entirely — the runner exchanges a short-lived token with your cloud provider.
The Gates
Before code reaches production, environments impose gates. Required reviewers must approve. Wait timers add cooling periods. Branch policies restrict which branches can deploy. Each deployment is logged — who deployed what commit, when, and to which environment.
The Cargo Bay
Artifacts and caches keep the pipeline efficient. Build outputs upload as artifacts for downstream jobs. Dependency caches avoid re-downloading node_modules or Maven jars on every run. Cache keys use lock file hashes so stale caches auto-evict when dependencies change.
The Template Factory
Reusable workflows are the template factory. A central repo defines standard CI/CD patterns — build, test, deploy — and other repos call them like functions. Inputs customise behaviour, secrets flow through securely, and outputs return results. Composite actions serve a similar purpose at the step level.
The Command Centre
Enterprise admins govern from the command centre. Policies control which actions are permitted — allowing only verified creators or pinned SHA references. Runner groups distribute self-hosted capacity across teams. Audit logs capture every workflow run, secret access, and policy change for compliance.
