What Is GitHub Actions?
GitHub Actions runs automated workflows in response to events in your repository.
GitHub Actions is GitHub's built-in automation and CI/CD platform. When something happens in your repo — a push, a new PR, a release — Actions can run a workflow automatically.
The building blocks
- Event — what triggers the workflow (e.g.
push). - Workflow — a YAML file in
.github/workflows/. - Job — a set of steps that run on one machine.
- Step — a single command or reusable action.
- Runner — the virtual machine that executes a job.
Example
# .github/workflows/hello.yml
name: Hello Actions
on: push
jobs:
greet:
runs-on: ubuntu-latest
steps:
- run: echo "Hello from GitHub Actions!"When to use it
- A team automates running tests on every push so broken code is caught before it reaches main.
- A developer uses a GitHub Actions workflow to publish an npm package automatically when a new tag is pushed.
- An operations team uses Actions to deploy a Docker image to AWS ECS every time a PR merges into main.
More examples
Minimal hello-world workflow
The simplest possible workflow: triggers on any push, spins up an Ubuntu runner, and runs a shell command.
name: Hello World
on: [push]
jobs:
greet:
runs-on: ubuntu-latest
steps:
- name: Print greeting
run: echo "Hello from GitHub Actions!"Workflow with checkout step
Adds the checkout action to clone the repo into the runner, then installs dependencies and builds the project.
name: Build
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install deps
run: npm ci
- name: Build
run: npm run buildList available runner environments
Shows the three hosted runner operating systems available on GitHub Actions by running the same step across all three.
jobs:
info:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- run: echo "Running on ${{ matrix.os }}"
Discussion