Skip to main content

Command Palette

Search for a command to run...

⚡ Day 02: Building a CI/CD Pipeline with GitHub Actions

Published
3 min read
⚡ Day 02: Building a CI/CD Pipeline with GitHub Actions
A

Tech-driven, cloud-focused, and growth-minded ☁️ Building skills in cloud engineering with a DevOps base. Passionate about learning and solving real problems.

Welcome back to Day 02 of my GitHub Actions Learning Journey.
Yesterday, we covered the basics of workflows, jobs, steps, and triggers.
Today, we’ll take things a step further and build a simple CI/CD pipeline for a Node.js project 🚀.


🤔 Quick Recap: What Are Actions?

Actions are reusable building blocks in GitHub Actions workflows.
They can be official (from GitHub), community-made, or custom-built.
Think of them as predefined steps that save you from writing the same logic again and again.

👉 Example: actions/checkout@v3 is an official action that pulls your repo code into the workflow.


🏃 What is a Runner?

A runner is a server that executes your workflow jobs.
When you define a job, you tell GitHub what kind of machine it should run on.

👉 Example:

runs-on: ubuntu-latest

This means the job will run on a Linux VM provided by GitHub.
GitHub also supports Windows and macOS runners.


⚡ Events & Push Trigger

Workflows need events to start.
An event is what tells GitHub Actions: “Hey, time to run this workflow!”

For example:

on: push

This means the workflow runs every time you push code to the repository.


🛠 Our Project: Lint → Test → Build → Deploy

We’ll now create a pipeline with four jobs:

  1. Lint → check code formatting & issues

  2. Test → run tests on the code

  3. Build → prepare the code for deployment

  4. Deploy → dummy step that just prints “Deploying…”

👉 I’ve already set this up in my GitHub repo along with a small Node.js application.

🔗 Repo: GitHub Actions Learning Journey

Inside the repo, you’ll find:

  • Workflow file: .github/workflows/day02-node-pipeline.yml

  • Example Node.js app: docs/day02/day02-node-app


✅ Steps to Run Day 02 Workflow

  1. Fork the repo

  2. Navigate to the Actions tab

    • In your forked repo, click the Actions tab.
  3. Select Day 02 Workflow

  4. Trigger the Workflow

    • push your commit and the workflow will automatically triggered.
  5. View Results


🔗 What is needs?

The keyword needs defines dependencies between jobs.
It makes sure one job only runs after another has finished successfully.

👉 Example:

This ensures a proper flow in your pipeline, just like in real CI/CD setups.


🎯 Summary

Today, you learned:
✔️ What Actions are (and used one: checkout)
✔️ What a runner and runs-on mean
✔️ How workflows trigger with the push event
✔️ How job dependencies work with needs
✔️ Built a real CI/CD pipeline with 4 jobs

This is the foundation of real-world pipelines. From here, we’ll expand into more advanced features.


🔗 Follow My Journey

📌 I’m documenting everything in public! You can follow along here:


Mastering GitHub Actions

Part 2 of 8

A practical series on learning GitHub Actions step by step. From writing your first workflow to deploying Docker containers and Terraform, this series will cover everything you need to build powerful CI/CD pipelines.

Up next

🚀 Day 03: Events & Triggers in GitHub Actions

Yesterday, we built our first CI/CD pipeline for a Node.js app. But an important question remains: 👉 When should these workflows run? That’s where events and triggers come in. ⚡ What Are Events & Triggers? Event → Something that happens in your re...

More from this blog

T

The Cloud Engineer’s Log

36 posts

A practical logbook of cloud engineering—architecture, infrastructure as code, automation, and real-world problem solving in modern cloud environments.