My First CI/CD Pipeline with GitHub Actions – A Beginner’s Journey into DevOps

Sonali DesaiSonali Desai
3 min read

Hi! I'm Sonali Desai, currently exploring the world of DevOps and CI/CD as a CSE undergrad. I recently built my first CI/CD pipeline using GitHub Actions, and I want to share my experience — not just how I did it, but all the questions that popped up in my mind.

If you’re a beginner, this is for you.

🧠 What Even Is CI/CD?

CI/CD stands for:

  • Continuous Integration: Automatically testing your code when changes are pushed.

  • Continuous Deployment/Delivery: Automatically deploying your app if tests pass.

Why is this useful?

Because we’re human. We forget to run tests, we make mistakes, and it’s better to let automation handle the boring stuff.

❓ My Beginner Questions

When I started, I had questions like:

  • “If the code works locally, why test it again on GitHub?”

  • “What is this runner thing?”

  • “Why does it only run tests and not my code?”

  • “Why would two devs write the same test case?”

Let me answer all of these now that I’ve understood them clearly.

Step-by-Step: How I Built My First GitHub Actions Workflow

1. created a simple Node.js project:

npm init -y
npm install --save-dev jest

I wrote a small test file: sum.test.js

const sum = require('./sum');
test('adds 1 + 2 to equal 3', () => {
  expect(sum(1, 2)).toBe(3);
});

I created .github/workflows/test.yml with:

name: Run Tests

on:
  push:
    branches: [main]

jobs:
  test:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v4

      - name: Set up Node.js
        uses: actions/setup-node@v4
        with:
          node-version: 18.x

      - name: Install dependencies
        run: npm install

      - name: Run tests
        run: node ./node_modules/jest/bin/jest.js

🤖 What is a "Runner"?

A runner is a virtual machine (VM) that GitHub spins up just for you.

When your workflow triggers (like after a push), GitHub:

  • Creates a clean Ubuntu VM

  • Downloads your code

  • Installs dependencies

  • Runs the steps you wrote

  • Deletes the VM after the job is done

🧽 It's clean. 🔁 It's repeatable. 🧪 It's consistent.


🤔 “If it works locally, why test on GitHub?”

Because your machine:

  • Might have hidden configs

  • Might be using a different Node version

  • Might skip tests you forgot to run

CI ensures that your code runs in a clean environment, exactly how production would see it.

✅ It removes the “but it worked on my machine!” excuse.


🧪 “Why does it only run tests, not my full code?”

Because I told it to:

run: node ./node_modules/jest/bin/jest.js

Your code is downloaded, but only the test command is run — GitHub doesn’t know what your app does unless you tell it.

This is what makes CI/CD customizable and powerful.

My Takeaways as a Beginner

  • GitHub Actions is beginner-friendly once you try it hands-on.

  • CI/CD is not just automation — it’s about confidence in your code.

  • Asking “why” helped me understand how DevOps works, not just how to set it up.

🔗 Want to try it yourself?

Check out my GitHub repo 👉https://github.com/desai983sonali/test-actions-demo

Thanks for reading 💙

0
Subscribe to my newsletter

Read articles from Sonali Desai directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Sonali Desai
Sonali Desai