Module 4 · Project 04 · Build Your First CI Pipeline · Lesson 15 of 48
What CI is and how a workflow is built
Continuous integration, and the parts of a GitHub Actions workflow: triggers, jobs, steps and runners.
In this lesson · about 25 minutes
- Explain continuous integration and why teams use it
- Read a GitHub Actions workflow: on, jobs, runs-on, steps, uses and run
- Write a workflow that installs, lints, tests and builds
Continuous integration
When several people change the same code, mistakes hide until someone merges, and then everything breaks at once. Continuous integration (CI) means every push is automatically checked: the code is installed, linted, tested and built on a clean machine, and the result shows up on the pull request within minutes. Broken changes are caught while they're small and fresh in the author's mind.
The parts of a pipeline
- Trigger: what starts it, such as a push or a pull request.
- Runner: the machine that does the work, a fresh virtual machine or container each time.
- Jobs: groups of steps. Jobs run in parallel unless one
needsanother. - Steps: individual commands, or ready-made actions such as "check out the code".
- Artifact: a file the pipeline produces and keeps, such as a build or a test report.
We'll use GitHub Actions because it's free for public repos and lives next to your code. Jenkins and GitLab CI use the same ideas with different syntax.
# .github/workflows/ci.yml
name: CI
on:
push:
branches: [main]
pull_request:
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4 # get the code
- uses: actions/setup-node@v4 # install Node
with:
node-version: 22
cache: npm # cache downloaded packages
- run: npm ci # install exact versions
- run: npm run lint
- run: npm test
- run: npm run build
- uses: actions/upload-artifact@v4 # keep the build
with:
name: app-build
path: dist/
Each run step is a shell command; if it exits with a non-zero code (remember Project 01?), the step fails, the job fails, and the pull request shows a red ✗.
Try it · watch it run
Watch a CI pipeline run
Push and watch the jobs run. Then push a lint error or a failing test, and try turning caching and parallel jobs off and on to see the run time change.
Whiteboard · watch and try
From push to green check
Press Play to see what happens after git push.
Tip: press Pause, then use the pen to work along on the board. Space plays and pauses; Ctrl+Z undoes your last mark.
Hands-on lab (simulated terminal)
Lab: your first workflow
A repo with the notes app and the ci.yml above. You're using the GitHub CLI (gh).
Step 1 of 5. Type each command and press Enter. Nothing runs on your computer.
1. Create a branch called add-ci.
Check your understanding0 of 3 correct
Key terms
Say the meaning to yourself, then tap a card to check.
Quiz score: 0 of 3
Written by Noviq Academy in its own words. The labs are simulations: no real servers are touched. When you build the projects yourself, use a practice virtual machine or a free-tier cloud account you control, watch your cloud spending, and never run cleanup or delete commands on a machine you care about. Tool names belong to their owners; versions and output are shown for learning and may differ slightly from yours. Read-aloud and the whiteboard voice use your device's built-in voices.