What is Github Actions ?
GitHub Actions is a CI/CD tool that automates workflows like building, testing, and deploying code directly from a GitHub repository based on events such as pushes or pull requests.
⚙️ Continuous Integration (CI)
Continuous Integration (CI) automatically builds and tests your code whenever you push changes to a repository, helping catch errors early.
👉 Example/Use Case: When you push code to GitHub, tests run automatically to ensure your new feature doesn’t break existing functionality.
🚀 Continuous Deployment (CD)
Continuous Deployment (CD) automatically deploys your code to production after it passes all tests and checks.
👉 Example/Use Case: After your code passes tests, it is automatically deployed to a live server like Vercel or Render without manual steps.
🏗️ GitHub Actions Architecture (Simple Explanation)
You can explain it like a flow 👇
GitHub Actions works on an event-driven architecture where a trigger starts a workflow, which runs jobs made up of steps on a runner.
Overall workflow
Event → Workflow → Jobs → Steps → Runner
⚙️ 1. Event (Trigger)
This is what starts everything.
Examples:
push
pull_request
schedule
👉 Example:
When you push code to GitHub, it triggers the workflow.
📄 2. Workflow
A YAML file inside .github/workflows/
Defines what should happen
👉 It contains:
Events
Jobs
🧩 3. Jobs
A workflow can have multiple jobs
Each job runs independently
👉 Example:
Job 1 → Install dependencies
Job 2 → Run tests
🔹 4. Steps
Each job is made of steps
Steps are individual tasks
👉 Example:
Checkout code
Install Node.js
Run tests
🖥️ 5. Runner
A machine that executes the job
Types:
Ubuntu (most common)
Windows
macOS
💻 Practical Example: Running Tests with GitHub Actions
To understand GitHub Actions better, let’s look at a simple real example.
In this project, I created a basic Python function that adds two numbers and wrote test cases to verify its correctness.
Here is addtion.py(python) file
def add(a, b):
return a + b
def test_add():
assert add(1, 2) == 3
assert add(1, -1) == 0
Here is the GitHub Actions workflow file:
name: My First GitHub Actions
on: [push]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8, 3.9]
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest
- name: Run tests
run: |
cd src
python -m pytest addition.py
📁 Where to Place the Workflow File
For GitHub Actions to work, the YAML file must be placed in this path:
.github/workflows/first-actions.yaml
👉 Explanation:
.github/ → Special GitHub folder
workflows/ → Stores all workflow files
.yaml file → Your automation script
⚠️ If you place the file anywhere else, GitHub Actions will NOT run.
I actually implemented this in one of my projects to understand it better.
You can take a look at the full setup here:
👉 https://github.com/Sunny-2610/github_actions
United States
NORTH AMERICA
Related News
UCP Variant Data: The #1 Reason Agent Checkouts Fail
7h ago
Amazon Employees Are 'Tokenmaxxing' Due To Pressure To Use AI Tools
21h ago
How Braze’s CTO is rethinking engineering for the agentic area
10h ago

Décryptage technique : Comment builder un téléchargeur de vidéos Reddit performant (DASH, HLS & WebAssembly)
17h ago
How AI Reduced Manual Driver Verification by 75% — Operations Case Study. Part 2
4h ago