In one sentence
GitHub Actions is a CI/CD platform that automatically runs steps written as YAML inside your repository, triggered by events like push / PR / schedule.
Each job spins up a fresh, disposable VM (runner), clones the entire repository, runs the steps in order, and then discards the VM. You can automate tests, builds, deployments, releases, and issue management โ anything goes.
How it works (core concepts)
Itโs very simple: when an event fires, borrow a clean VM, clone the repo, and run the steps you wrote โ in order.
- ๐ Location โ
.github/workflows/*.yml(multiple files supported) - โก Triggers โ
push/pull_request/schedule(cron) /workflow_dispatch(manual) /issues/releaseand 35+ other events - ๐ฅ๏ธ Execution environment โ a fresh GitHub-hosted runner (Linux / Windows / macOS VM) starts up per job
- ๐ฆ Repo cloned every time โ
actions/checkoutfull-clones into$GITHUB_WORKSPACE(no state carried over from previous jobs) - โฑ๏ธ Time limits โ 6 hours max per job, 35 days max per workflow (matrix parallelism is supported)
- ๏ฟฝ๏ฟฝ Secrets โ stored in
Settings โ Secretsโ referenced as${{ secrets.NAME }}(masked in logs)
๐ง โStart from scratch every timeโ is the golden rule of GitHub Actions. To persist state, use
actions/cache, artifacts, or rely on already-deployed infrastructure.
GitHub-hosted runners vs Self-hosted runners
| Aspect | ๐ข GitHub-hosted runner | ๐ ๏ธ Self-hosted runner |
|---|---|---|
| Management | GitHub provides, updates, and discards | You run it on your own server / VM / k8s |
| OS | Linux / Windows / macOS | Anything (Raspberry Pi, on-prem LAN, GPU machines) |
| Network | Public internet | Direct access to internal networks / VPN resources |
| Scale | Auto-starts on demand, unlimited parallelism (within plan limits) | You manage capacity |
| Cost | Time-based billing (see table below) | Runner itself is free (just your own infra costs) |
| Use case | General CI/CD, OSS, lightweight jobs | Dedicated hardware, internal resource access, sensitive workloads, huge builds |
๐ As a middle ground, consider larger runners (high-spec GitHub-hosted) or Actions Runner Controller to run auto-scaling self-hosted runners on k8s.
Reuse components from the Marketplace
You donโt have to write everything from scratch. GitHub Marketplace has 20,000+ reusable actions.
steps:
- uses: actions/checkout@v4 # GitHub official: clone repo
- uses: actions/setup-node@v4 # Set up Node.js environment
with: { node-version: 20 }
- uses: docker/build-push-action@v5 # Build & push Docker image
- uses: aws-actions/configure-aws-credentials@v4
- ๐ท๏ธ Official verified actions โ GitHub, AWS, Azure, GCP, Docker, HashiCorp, and other major vendors
- ๐ OSS actions โ anyone can publish (
uses: owner/repo@shato reference) - ๐ Always pin versions โ commit SHA pins are safer than tags (
@v4) against supply chain attacks - ๐ก๏ธ Org allowlist โ restrict available actions via
Settings โ Actions โ Allowed actions
Getting started (fastest path)
Just drop a .github/workflows/ci.yml:
name: CI
on:
push: { branches: [main] }
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
The moment you push, execution logs appear in the Actions tab. Failures show as โ on the PR.
๐ Start with
runs-on: ubuntu-latestfor everything, then scale out to Windows / macOS / larger runners / self-hosted as needed.
Eligibility and pricing
Public repos get GitHub-hosted runners completely free โ only concurrency limits apply. Private repos get a monthly free tier per plan; overages are pay-as-you-go.
Free tier per plan (private repos / month)
| Plan | Actions minutes / month | Storage |
|---|---|---|
| Free | 2,000 min | 500 MB |
| Pro | 3,000 min | 1 GB |
| Team | 3,000 min | 2 GB |
| Enterprise | 50,000 min | 50 GB |
๐ก Free tier counts Linux as 1ร multiplier. Windows consumes 2ร and macOS consumes 10ร โ watch out.
Per-OS / per-size unit pricing (overages ยท 2-core standard)
| OS / Runner | Multiplier | Unit price (USD/min) | Notes |
|---|---|---|---|
| Linux 2-core | 1ร | $0.008 | Standard, cheapest |
| Windows 2-core | 2ร | $0.016 | 2ร Linux |
| macOS 3-core | 10ร | $0.08 | iOS / Mac builds |
| Linux 4-core (larger) | โ | $0.016 | Team / Enterprise |
| Linux 8-core (larger) | โ | $0.032 | |
| Linux 16-core (larger) | โ | $0.064 | |
| Linux 64-core (larger) | โ | $0.256 | Huge builds |
| GPU runner | โ | $0.07+ | ML / inference |
๐ฐ Storage overages are $0.25 / GB (artifacts + Actions cache + Packages combined).
๐ ๏ธ Self-hosted runners incur no GitHub billing (as of now). Running on your own server / k8s means execution time is free โ you just pay for your own infrastructure and electricity.
๐ Billing is usage-time-based, not per active committer. Even a solo developer who runs CI heavily will see charges.
Cloud Agent / Copilot Code Review also run here
๐ค When Copilot Cloud Agent implements a task, or when Copilot Code Review reads a PR โ both run as GitHub Actions workflows under the hood. They consume Actions free-tier minutes and appear as Actions logs. See Cloud Agent and Copilot Code Review for details.