GitHub Actions Basics
Automating your workflow
Pixl presents
Running the same checks by hand every single time? Cute. GitHub Actions does it for you on every push.Running the same checks by hand every single time? Cute. GitHub Actions does it for you on every push.

Imagine if every time you pushed code, something automatically checked it for errors, ran your tests and even published your website. That's GitHub Actions. It automates the boring stuff so you don't have to do it by hand.
What are GitHub Actions?#
GitHub Actions is a tool built right into GitHub that runs tasks automatically when certain things happen. Those automated tasks are called "workflows."
Here's the kind of stuff people automate.
- Run tests when code is pushed
- Check code for style issues
- Build and deploy websites
- Send notifications
- Create releases
I learned the "humans forget" lesson the hard way. I once had a client's forms break over a weekend, and nobody knew until Monday when dozens of them were already dead. Nothing was checking. An automated check that yells the moment something breaks is worth its weight in gold (and a whole lot cheaper than finding out from an angry client).
How It Works#
GitHub Actions runs on a simple trigger-and-action setup.
Trigger - "When this happens..."
- Someone pushes code
- A Pull Request gets opened
- A scheduled time hits (like every day at midnight)
Action - "...do this"
- Run tests
- Build the project
- Deploy to a server
Workflows#
A workflow is a set of instructions that tells GitHub Actions what to do. Workflows live in your repository in a special folder.
your-repo/
.github/
workflows/
my-workflow.ymlThe .yml file holds the instructions in a format called YAML (officially "YAML Ain't Markup Language," because developers can't resist a nerdy joke). Don't sweat it, you don't have to write these yourself. Claude Code can make them for you!
A Simple Example#
Here's what a basic workflow looks like.
name: Run Tests
on:
push:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Set up Node.js
uses: actions/setup-node@v7
with:
node-version: '24.x'
- name: Install dependencies
run: npm ci
- name: Run tests
run: npm testLet's break it down.
| Part | What It Means |
|---|---|
name: Run Tests | What to call this workflow |
on: push | Run when code is pushed |
branches: [main] | Only for the main branch |
runs-on: ubuntu-latest | Use a Linux computer |
actions/checkout@v7 | Download the code |
actions/setup-node@v7 | Install Node.js (version 24 here) |
run: npm ci | Install your project's packages from the lockfile |
run: npm test | Run the test command |
Seeing Actions in Action#
When a workflow runs, you can watch it happen on GitHub.
Step 1. Go to Your Repository#
Open your repository on GitHub.
Step 2. Click the Actions Tab#
You'll find the "Actions" tab along the top of the page.
Step 3. View Workflow Runs#
Every time a workflow runs, it shows up here. Click one to see the details.
Step 4. Check the Results#
Green checkmark means success. Red X means something failed. Click it to see what happened.
Common Uses for GitHub Actions#

Running Tests#
This is the BIG one. Every time you push code, here's what happens.
- GitHub Actions starts up
- It downloads your code
- It installs your project's packages
- It runs your tests
- It reports success or failure
If tests fail, you'll see a red X on your Pull Request, warning you before you merge broken code.
Building and Deploying#
For websites and apps it goes like this.
- You push code to main
- GitHub Actions builds your project
- It deploys automatically to your hosting service
No manual deploying needed!
Code Quality Checks#
You can automatically check for things like these.
- Code style issues
- Security vulnerabilities
- Outdated dependencies
These checks can run on every single Pull Request.
Status Checks on Pull Requests#
When you open a Pull Request, GitHub Actions runs your workflows and shows you the results.
- Pending - Yellow dot, still running
- Success - Green checkmark, all good
- Failure - Red X, something's wrong
Lots of teams require every check to pass before anyone's allowed to merge.
Getting Started#
You don't have to build workflows by hand. Here are a couple easy ways to add them.
Option 1: GitHub Workflow Templates#
- Go to Actions tab in your repository
- GitHub suggests workflow templates based on your project
- Click "Configure" on one you like
- Click "Commit changes"
Option 2: Ask Claude Code#
Just tell Claude Code what you want to automate.
- "Set up a workflow to run tests on every push"
- "Create an action to deploy when I push to main"
- "Add a workflow to check my code style"
Claude Code will make the workflow file for you!
TL;DR#
- GitHub Actions automates tasks when certain events happen
- Common uses are running tests, deploying code and checking quality
- Workflows live in
.github/workflows/as YAML files - You can see the results in the Actions tab
- Claude Code can create workflow files for you
What's Next?#
You've learned a TON about Git and GitHub! In the last lesson of this module, we'll see how Claude Code makes all of this even easier by handling the Git work for you...
This lesson ends with a short activity.