Manuals / CI/CD Pipelines / Chapter 3
A · Foundations · beginner · Week 1–2 · Chapter 3 of 12
First GitHub Actions workflow
YAML workflow: on trigger, jobs, steps, runs-on. Install, test, fail loud on red.
Path progress19%
Step 1 of 4
Hello workflow
on: push, jobs.test, runs-on: ubuntu-latest, steps: checkout, setup, run tests.
Example
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20"
- run: npm ci
- run: npm testDo this now
Add .github/workflows/ci.yml. Push. See green check on commit.
Was this step clear?
Chapter learning outcomes
- Workflow structure
- Triggers
- Jobs and steps
- Action marketplace
Clear these before you leave
Side quest
Matrix awareness
Read docs on strategy.matrix. Sketch Node 18 + 20 matrix — optional implement.