CurriculumGitHub FundamentalsIntro to GitHub Actions
Lesson 7 of 888%
Intermediate9 min+90 XP

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).

Commit Timeline
a1b2c3d
init
b2c3d4e
feat
c3d4e5f
fix
d4e5f6a
HEAD

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.

Distributed Architecture
💻
Your Local
push / pull
☁️
GitHub (Remote)
push / pull
💻
Teammate's Local

Commands

commands — click to reveal output
$
mkdir -p .github/workflows
Create the workflows directory
$
# .github/workflows/ci.yml
Create your workflow file here
$
# Workflow structure: # name: CI # on: [push, pull_request] # 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 test
Basic CI workflow YAML
$
git add .github/ && git commit -m "Add CI workflow"
Commit and push to activate the workflow
$
gh run list
View recent workflow run results
▼ show output
$
gh run watch
Watch a live workflow run in real time
KNOWLEDGE CHECK

What format are GitHub Actions workflow files written in?

Rate this lesson:
PreviousNext Lesson