Now that you know what CI/CD does, this is the tool that makes it happen on GitHub: GitHub Actions.

Think of it as a written checklist that GitHub follows whenever something happens in your repository. The checklist is called a workflow.

Workflow file location

Workflow files live in:

.github/workflows/

Example:

.github/workflows/ci.yml

The five words you need to know

An action is a reusable step written by GitHub or the community. For example, actions/checkout downloads your repository onto the runner.

See it in one example

A workflow has a name, triggers, jobs, and steps.

name: CI

on:
  pull_request:

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: npm test

Read it like a sentence: “Call this workflow CI. When a pull request changes, use an Ubuntu computer, download my code, and run the tests.”

What happens when it runs?

GitHub creates a fresh runner for the job. The runner starts empty, so your workflow normally checks out the code, installs dependencies, and then runs your commands. When the job ends, that temporary machine goes away.

Events

Examples:

Jobs

Jobs are groups of steps that run on a runner.

Jobs run in parallel by default unless you define dependencies with needs.

jobs:
  build:
    runs-on: ubuntu-latest
  deploy:
    needs: build
    runs-on: ubuntu-latest

Steps

Steps run commands or actions.

Runners

A runner is the machine that executes the job.

Common hosted runner:

Self-hosted runners are possible, but they require security and maintenance planning.

Quick revision