What are workflows, jobs, steps and actions in GitHub Actions?
BeginnerConceptGitHub Actions
Answer
A workflow is a YAML file in .github/workflows/ triggered by events. It contains jobs, which run on separate runners (in parallel by default). A job contains sequential steps, each either a shell command (run:) or an action (uses:), a reusable unit such as actions/checkout@v4. Steps in one job share the filesystem; jobs do not, so you pass data via outputs and artifacts.
name: ci
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: npm ci && npm test
More on GitHub Actions
What events can trigger a workflow?BeginnerWhat is the difference between `pull_request` and `pull_request_target`?AdvancedWhat is a runner, and how do GitHub-hosted and self-hosted runners differ?BeginnerHow do you pass data between steps and between jobs?IntermediateHow does a build matrix work?IntermediateWhat are reusable workflows and how do you call one?Intermediate