01 — Actions fundamentals
The five nouns, as Kubernetes
| Actions | Kubernetes |
|---|---|
workflow = .github/workflows/*.yml | the manifest |
| run = one execution | — |
| job | Pod — own VM, own empty disk, dies at the end |
| step | a container inside it, in order |
runner (runs-on:) | the node |
- Steps share a disk. Jobs do not → that's what
upload-artifact/download-artifactare for. - Your repository is not on the runner →
uses: actions/checkout@v5. This is the number-one first-workflow failure. - Default is parallel.
needs:is the only thing that waits. uses:calls a published action ·run:runs shell.- A step passes or fails on its exit code.
|| truegives you green that did nothing.
Skeleton
name: ci
on:
push:
branches: [main]
pull_request:
workflow_dispatch: # the manual button
permissions:
contents: read
id-token: write # only if this file talks to AWS
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- run: make test
deploy:
needs: build
runs-on: ubuntu-latest
steps:
- run: ./deploy.sh
on: is a list of triggers, not one. All three above can fire the same file.
gh CLI
gh run list --limit 5 gh run watch # live tail of the current run gh run view <ID> --log gh workflow run <file.yml> # fire workflow_dispatch gh pr checks <N> --watch
workflow_dispatch only offers a button for workflows that already exist on the
default branch. A new one has to be merged before you can fire it.
Hosted against self-hosted runners
| hosted | self-hosted | |
|---|---|---|
| state | nothing survives | leftovers survive — a feature and a risk |
| network | public internet only | reaches your private VPC or LAN |
| cost | free on public repos; 2000 min/month free on private | your hardware |
Pre-installed on hosted runners: git, docker, aws, node, python, jq. Not Terraform →
hashicorp/setup-terraform.
In VS Code
GitHub.vscode-github-actions: Actions icon in the rail → Workflow Runs → job → step → the log in a tab. No browser round-trip.- Ctrl+Space is schema completion, and indentation decides which keys you are offered — at column zero you get top-level keys, not triggers.