GitHub Actions - CI/CD for Beginners (2026 Guide)

Learn GitHub Actions! Automate your workflow with CI/CD, testing, and deployments directly from GitHub!

Introduction

GitHub Actions is GitHub's CI/CD platform! Let's automate everything!

What You Will Learn

  • What is CI/CD
  • GitHub Actions basics
  • Workflows, Jobs, Runners
  • Create your first workflow

Prerequisites

What is CI/CD?

  • CI (Continuous Integration): Automatically test code when you push!
  • CD (Continuous Deployment): Automatically deploy when tests pass!

GitHub Actions Terms!

  • Workflow: Automated process!
  • Event: Triggers a workflow (push, PR, etc.)!
  • Job: Series of steps!
  • Step: Individual task (run a command)!
  • Runner: Machine that runs the workflow!

Your First Workflow!

Create .github/workflows/ci.yml in your repo!

name: CI
on: [push, pull_request]

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Use Node.js
        uses: actions/setup-node@v4
        with:
          node-version: '20'
      - name: Install dependencies
        run: npm install
      - name: Run tests
        run: npm test

That's it! Now every push and PR will run your tests!

Example: Deploy to Vercel!

name: Deploy to Vercel
on: [push]

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: amondnet/vercel-action@v25
        with:
          vercel-token: ${{ secrets.VERCEL_TOKEN }}
          vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
          vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
          vercel-args: '--prod'

Secrets!

Store API keys, tokens, etc. in GitHub Secrets! Go to your repo → Settings → Secrets and variables!

Best Practices!

  1. Keep workflows simple: One job per concern!
  2. Use caching: Speed up runs!
  3. Test workflows: Make sure they work!

Summary

GitHub Actions lets you automate everything!

Related Articles

Previous Tutorial

Advanced Git

Next Tutorial

Let's learn security! → Git Security