How to Set Up a CI/CD Pipeline with GitHub Actions in 15 Minutes

Great for freelancers & beginners! Struggling to Automate Your Deployments? You're Not Alone. Imagine this: you've just finished coding a feature you're super proud of. But every time you push code, you have to manually build, test, and deploy it. It's exhausting, right? Good news! You can automate all that in just 15 minutes with GitHub Actions — no servers, no complicated setups, no headaches. Whether you're a freelancer juggling multiple projects or a beginner building your portfolio, this guide is for you. Let's get started! What You'll Need A GitHub account A repository (any project will do) Basic understanding of Git commits and branches (That's it — no fancy tools required!) Step 1: Create a .github/workflows Folder Inside your project repo, create a new folder: mkdir -p .github/workflows This is where GitHub Actions looks for workflow files. Step 2: Add Your First Workflow YAML File Create a file named ci-cd.yml inside .github/workflows: name: CI/CD Pipeline on: push: branches: [ main ] pull_request: branches: [ main ] jobs: build: runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v4 - name: Set up Node.js (or your environment) uses: actions/setup-node@v4 with: node-version: '18' - name: Install dependencies run: npm install - name: Run tests run: npm test - name: Deploy (example step) run: echo "Deploying your app..." Step 3: Push and Watch the Magic Happen After saving the YAML file, push your changes to GitHub: git add . git commit -m "Add basic CI/CD workflow" git push origin main Now go to your GitHub repo > Actions tab. You'll see your workflow running automatically!

Apr 27, 2025 - 11:25
 0
How to Set Up a CI/CD Pipeline with GitHub Actions in 15 Minutes

Great for freelancers & beginners!

Struggling to Automate Your Deployments? You're Not Alone.

Imagine this: you've just finished coding a feature you're super proud of. But every time you push code, you have to manually build, test, and deploy it. It's exhausting, right?

Good news! You can automate all that in just 15 minutes with GitHub Actions — no servers, no complicated setups, no headaches.

Whether you're a freelancer juggling multiple projects or a beginner building your portfolio, this guide is for you. Let's get started!

What You'll Need

  • A GitHub account
  • A repository (any project will do)
  • Basic understanding of Git commits and branches

(That's it — no fancy tools required!)

Step 1: Create a .github/workflows Folder

Inside your project repo, create a new folder:

mkdir -p .github/workflows

This is where GitHub Actions looks for workflow files.

Step 2: Add Your First Workflow YAML File

Create a file named ci-cd.yml inside .github/workflows:

name: CI/CD Pipeline

on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
    - name: Checkout code
      uses: actions/checkout@v4

    - name: Set up Node.js (or your environment)
      uses: actions/setup-node@v4
      with:
        node-version: '18'

    - name: Install dependencies
      run: npm install

    - name: Run tests
      run: npm test

    - name: Deploy (example step)
      run: echo "Deploying your app..."

Step 3: Push and Watch the Magic Happen

After saving the YAML file, push your changes to GitHub:

git add .
git commit -m "Add basic CI/CD workflow"
git push origin main

Now go to your GitHub repo > Actions tab. You'll see your workflow running automatically!