Robots that check every push
Every time someone pushes code, something should check it still works: install, lint, test, build — and, if all is green, deploy. Doing that automatically is CI/CD (continuous integration and delivery). GitHub Actions runs it for you on GitHub's machines, described in a YAML file in your repository.
A workflow is a recipe card pinned to the repo: *when* this happens (a push), *on* this kitchen (a fresh Ubuntu machine), *do* these steps.
Anatomy of a workflow
name: Hello CI
on: push
jobs:
hello:
runs-on: ubuntu-latest
steps:
- name: Say hello
run: echo "Hello from GitHub Actions"
- name: Look around
run: |
whoami
node --version
echo "Triggered by ${{ github.event_name }} on ${{ github.ref_name }}"YAML is indentation-sensitive: use spaces (two per level), never tabs. key: value pairs, and - starts a list item.