Set Up a CI Pipeline with GitHub Actions

Add a GitHub Actions workflow that installs dependencies and runs your tests and linter on every push and pull request.

intermediate15 minallUpdated August 2026
#github-actions#ci/cd#automation

Requirements

0/3 steps · 0%
01

Create the workflow directory

bash
$ mkdir -p .github/workflows

GitHub looks for workflow files anywhere under .github/workflows/ — the filename itself doesn't matter.

02

Define the workflow

.github/workflows/ci.yml
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

Note

Swap the npm/node steps for your stack's equivalents (pip install, pytest, etc.) — the trigger and job structure stay the same.

03

Commit, push, and watch it run

bash
$ git add .github/workflows/ci.yml
$ git commit -m "Add CI workflow"
$ git push

Open your repository's Actions tab on GitHub — the workflow starts automatically.

Success

A green check on your commit and pull requests means the pipeline passed.

Troubleshooting

Actions only picks up workflow files that are valid YAML, committed under `.github/workflows/`, and pushed to a branch that matches the `on:` trigger.

Check the file's indentation (YAML is whitespace-sensitive) and confirm it was actually pushed: git log --stat -1.