Intro to GitHub Actions
GitHub Actions is a built-in CI/CD platform on GitHub. Define automation workflows that trigger on events like code pushes, pull requests, or schedules. Run tests, build apps, and deploy code — all from YAML files in your repository.
01.Core Concepts
Workflow: a YAML file in .github/workflows/ that defines the entire automation pipeline. Event: what triggers it (push, pull_request, schedule, workflow_dispatch). Job: a group of steps running on one virtual machine. Step: a single unit — run a shell command or use a pre-built Action from the marketplace. Runner: the VM environment (ubuntu-latest, windows-latest, macos-latest).
02.A Real CI Workflow
On every push and pull request to main: check out the code, set up Node.js, install dependencies (npm ci — faster than npm install), run linting, run unit tests. If any step exits with a non-zero code, the job fails, you get an email notification, and GitHub shows a red ✗ on the commit. PRs cannot be merged until the checks pass.
Commands
What format are GitHub Actions workflow files written in?