Sunday, 15 March 2026

#03 GIT - CI/CD handson

Day 1: Fundamentals of DevOps - Blog Tutorial

Day 1: Zero to Hero DevOps

Understanding the "What," "Why," and the Culture of Modern Software Delivery

CONCEPT

What is DevOps?

Forget the complex textbook definitions. At its core, DevOps is a culture or practice adopted by organizations to increase their ability to deliver applications quickly [3, 4].

"DevOps is a process of improving application delivery by ensuring proper automation, quality, continuous monitoring, and testing." [5, 6]

The goal is simple: Reduce the time it takes to move code from a developer's laptop to the customer (e.g., from 2 weeks down to 1 week) without sacrificing quality [4, 6].

HISTORY

Why did DevOps Emerge?

Ten years ago, software delivery was a manual, fragmented process involving separate silos [7, 8]:

  • System Administrators: Created servers manually [9, 10].
  • Build & Release Engineers: Deployed the code [9, 11].
  • Testers: Verified the application manually [9].

This manual effort led to slow communication and inefficient systems [12, 13]. DevOps evolved to automate this entire pipeline, replacing multiple disconnected teams with one unified culture of delivery [12, 13].

CORE PRINCIPLES

The Four Pillars of DevOps

To succeed as a DevOps engineer, you must focus on these four areas [14, 15]:

  1. Automation: Reducing manual labor with tools like GitHub Actions [1, 2].
  2. Quality: Ensuring the code meets standards before delivery [1].
  3. Monitoring & Observability: Reporting back on the health of the system [5, 14].
  4. Testing: Continuous testing to validate that automation is correct [14].
PRACTICE

Hands-on: Automating Your First Check

To demonstrate the Automation pillar, we will use a GitHub Actions workflow to automatically greet you every time you push code [2, 16].

The Code (.github/workflows/devops-day1.yml)

name: Day1-Automation
on: [push] # Trigger on every push
jobs:
  check-quality:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout Code
        uses: actions/checkout@v4
      
      - name: Automated Greeting
        run: echo "DevOps Automation Started for ${{ github.actor }}!"
        

How-to Run

  1. Create a new GitHub repository.
  2. Create a folder .github, and inside it, a folder workflows.
  3. Create a file named devops-day1.yml and paste the code above.
  4. Commit and push. Go to the Actions tab to see your first automated DevOps process! [2]
Undergrad Challenge: Modify the workflow to include a second step that prints "System Monitoring Active" and the current date. This simulates two of the four pillars: Automation and Monitoring [14].
CI - QUALITY PILLAR

Continuous Integration: The Automated Quality Gate

As discussed, Quality and Testing are core pillars of DevOps [4]. CI is the practice of automatically building and testing your code every time a team member makes a change [5]. This ensures that "bugs" are caught early before they ever reach a customer [6, 7].

The Code (.github/workflows/ci-testing.yml)

name: CI-Quality-Check
on:
  pull_request:
    branches: [ "main" ] # Run when someone wants to merge code
jobs:
  test-code:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout Code
        uses: actions/checkout@v4
      
      - name: Set up Node.js
        uses: actions/setup-node@v4
        with:
          node-version: '20'

      - name: Install Dependencies
        run: npm install

      - name: Run Unit Tests
        run: npm test
        

How-to Run

  1. Create a simple Node.js project (npm init -y) in your repo.
  2. Add a basic test script in your package.json.
  3. Create a Pull Request. GitHub will automatically run your tests before allowing the merge.
Hands-on Exercise: Deliberately write a failing test in your code and push it. Observe how the CI Pipeline blocks the Pull Request, preventing "bad code" from reaching the main branch [7, 8].
CD - DELIVERY PILLAR

Continuous Deployment: Shipping at Speed

The end goal of DevOps is Delivery [9]. While CI checks for quality, Continuous Deployment (CD) automates the release of that checked code to a production environment or package registry [5, 10]. This reduces the delivery time from 10 days to just minutes [1, 9].

The Code (.github/workflows/cd-deploy.yml)

name: CD-Deploy-Package
on:
  push:
    branches: [ "main" ] # Run only after code is merged to main
jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout Code
        uses: actions/checkout@v4

      - name: Build Artifact
        run: |
          mkdir -p dist
          echo "Production Build version ${{ github.run_number }}" > dist/index.html
      
      - name: Upload Build Artifact
        uses: actions/upload-artifact@v4
        with:
          name: production-site
          path: dist/
        

How-to Run

This workflow simulates "building" your app. Once you push to the main branch, GitHub Actions will create a "Production Build" and store it as a Workflow Artifact [5].

Undergrad Challenge: Combine CI and CD! Research needs: [job_name] syntax in GitHub Actions to make the Deploy job only run if the Test job succeeds. This ensures you never deploy broken code [4, 8].

Based on Abhishek Veeramalla's DevOps Zero to Hero Course | Day 1

Saturday, 28 February 2026

#00 Action

GitHub Actions Tutorial for Undergrads

Mastering GitHub Actions: A Hands-On Guide

Step-by-step tutorials for undergraduate developers to automate workflows.

Module 1

Creating Your First Example Workflow

Learn the basics of GitHub Actions by creating a simple automated greeting [1, 2].

The Code (.github/workflows/hello-world.yml)

name: Greet User
on: [push]
jobs:
  hello-job:
    runs-on: ubuntu-latest
    steps:
      - name: Say Hello
        run: echo "Hello, GitHub Actions!"
        

How-to Run

  1. Create a directory named .github/workflows in your repo root.
  2. Save the code above as hello-world.yml.
  3. Commit and push to GitHub. Navigate to the Actions tab to see it run.
Hands-on Exercise: Modify the workflow to print your name and the current date using the date command.
Module 2

Building and Testing Code (Python Example)

Automate your Continuous Integration (CI) to ensure code quality with every push [1, 2].

The Code (.github/workflows/python-app.yml)

name: Python Package
on: [push]
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v4
    - name: Set up Python
      uses: actions/setup-python@v5
      with:
        python-version: '3.x'
    - name: Install dependencies
      run: pip install -r requirements.txt
    - name: Run Tests
      run: pytest
        

How-to Run

Ensure your repo has a requirements.txt and a tests/ directory. Push your code, and GitHub will automatically install dependencies and run tests [2].

Hands-on Exercise: Intentional failure! Create a test that fails and observe how GitHub Actions marks the build as failed with a red "X".
Module 3

Creating Custom Actions

Go beyond pre-built tools by creating your own JavaScript or Composite actions [2, 3].

The Code (action.yml)

name: 'Hello World Action'
description: 'Greet someone'
inputs:
  who-to-greet:
    description: 'Who to greet'
    required: true
    default: 'World'
runs:
  using: 'node20'
  main: 'index.js'
        

How-to Run

Define your metadata in action.yml and your logic in index.js. You can then reference this action in any workflow using uses: ./path-to-action [3].

Hands-on Exercise: Create a composite action that combines multiple shell commands into a single reusable step [3].
Module 4

Managing Work with Actions

Automate project management tasks like labeling issues or closing inactive ones [2, 3].

The Code

name: Label Issues
on:
  issues:
    types: [opened]
jobs:
  label_issue:
    runs-on: ubuntu-latest
    steps:
      - name: Label as 'triage'
        uses: actions/github-script@v7
        with:
          script: |
            github.rest.issues.addLabels({
              issue_number: context.issue.number,
              owner: context.repo.owner,
              repo: context.repo.repo,
              labels: ['triage']
            })
        

How-to Run

This workflow triggers whenever a new issue is opened. It uses the GITHUB_TOKEN for authentication [1, 2].

Hands-on Exercise: Set up a workflow to comment on an issue automatically when a specific label is added [2].
Module 5

Storing Data and Using Services

Learn to store workflow artifacts and use containerized services like Redis or PostgreSQL [2, 3].

The Code (Artifact Upload)

- name: Archive production artifacts
  uses: actions/upload-artifact@v4
  with:
    name: dist-files
    path: dist/
        

How-to Run

Use the upload-artifact action to save build results. For databases, use services in your job definition to spin up a Docker container [2].

Hands-on Exercise: Create a workflow that generates a text file, uploads it as an artifact, and then download it from the GitHub Actions UI [2].

© 2026 Tutorial Series | References: GitHub Docs [1-4]

#03 GIT - CI/CD handson

Day 1: Fundamentals of DevOps - Blog Tutorial Day 1: Zero to Hero DevOps Understanding the "What,...