DEV Community

Bhaskar Sharma
Bhaskar Sharma

Posted on

πŸš€ Day 14 of My DevOps Journey: GitHub Actions β€” CI/CD Made Easy in the Cloud ☁️

Hello dev.to community! πŸ‘‹

Yesterday, I explored Jenkins β€” a powerful on-premise CI/CD tool. Today, I’m stepping into GitHub Actions, a cloud-native CI/CD solution built directly into GitHub.

πŸ”Ή Why GitHub Actions Matters

Managing Jenkins servers can be heavy. GitHub Actions eliminates that by running pipelines directly in the cloud, triggered by repository events.

βœ… Native to GitHub (no extra setup)
βœ… Free tier with generous minutes for public repos
βœ… Marketplace with 10,000+ pre-built actions
βœ… Build, test & deploy directly from GitHub

🧠 Core GitHub Actions Concepts

Workflows β†’ YAML files (.github/workflows/ci.yml) that define your pipeline.

Jobs β†’ Group of steps executed on a runner.

Runners β†’ Virtual machines (Linux/Windows/Mac) where jobs run.

Actions β†’ Reusable steps (e.g., checkout code, setup Node.js, deploy to AWS).

πŸ”§ Example: Simple GitHub Actions Workflow

.github/workflows/ci.yml

name: CI Pipeline

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

jobs:
build:
runs-on: ubuntu-latest

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

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

- name: Install dependencies
  run: npm install

- name: Run tests
  run: npm test

- name: Deploy
  run: echo "Deploying application..."
Enter fullscreen mode Exit fullscreen mode

πŸ‘‰ Save this under .github/workflows/ in your repo. It will auto-trigger on push/pull requests to main.

πŸ› οΈ DevOps Use Cases

Automate build & test on every PR

Deploy apps to AWS, Azure, GCP, or Kubernetes

Run security scans with tools like Trivy or Snyk

Build and push Docker images automatically

Manage microservices CI/CD workflows

⚑ Pro Tips

Use matrix builds to test across multiple OS/language versions.

Store secrets in GitHub Secrets for secure pipelines.

Explore the GitHub Marketplace for ready-to-use actions.

Combine with GitHub Packages for container/image management.

πŸ§ͺ Hands-on Mini-Lab (Try this!)

1️⃣ Create a repo (or use an existing one).
2️⃣ Add a workflow file under .github/workflows/ci.yml.
3️⃣ Push your code β†’ GitHub Actions runs automatically.
4️⃣ Watch your build/test logs in the Actions tab.

🎯 Key Takeaway:
GitHub Actions brings serverless CI/CD directly into your GitHub workflow. It’s lightweight, scalable, and perfect for cloud-native DevOps.

πŸ”œ Tomorrow (Day 15):
I’ll dive into GitLab CI β€” another powerful CI/CD tool that’s popular for self-managed and cloud-native DevOps pipelines. πŸš€

πŸ”– #GitHubActions #DevOps #CICD #Automation #CloudNative #SRE

Top comments (0)