The independent file on technology, travel & lifeFrom Pakistan, for everywhere
Huzi Blogs.
The ArchiveSectionsSearch

Planning a trip? HTG Travels — flights, visas, hotels & Umrah, handled properly.

WhatsApp +92 317 5054959
Huzi Blogs.

An independent file on technology, travel and life — long-form guides written plainly, from Pakistan, for everywhere.

ShopMeet the Creator

Sections

  • Travel
  • Technology
  • Lifestyle
  • Programming
  • Sports
  • Linux
  • All sections

The Desk

  • The Archive
  • Search the file
  • Disclaimer & Data Privacy Policy
  • A project of huzi.pk

© 2026 blogs.huzi.pk — All rights reserved.

Set in Playfair Display & Inter

    HomeProgrammingStory
    Programming

    The Automation Edge: Mastering CI/CD with GitHub Actions in 2026

    H

    By Huzi

    File #94 · 4 min read

    If your deploy process involves SSH and hope, CI/CD is the fix: a machine that builds, tests and ships every change, the same way every time. GitHub Actions won by living inside the repository your code is already in — YAML files under .github/workflows/ that wake up on push, on pull request, on a cron schedule, or on demand.

    The quick answer: A pipeline is YAML in .github/workflows/ triggered by events, run as jobs on GitHub-hosted runners, with deploys gated behind passing tests. Pin permissions to least privilege, cache npm, and chain jobs with needs — the payoff is a broken build caught by a machine that never gets tired at 5 p.m. on a Friday.

    The moving parts

    Part What it is Why it matters
    Events Triggers: push, pull_request, schedule for cron, workflow_dispatch for manual The "when"
    Jobs Separate runners, chained with needs Order and isolation
    Steps Your commands, or prebuilt actions from the marketplace The "what"
    Runners GitHub-hosted Ubuntu, Windows and macOS, plus ARM64 Linux — free on public repositories The "where"

    A pipeline you can actually use

    name: CI
    
    on:
      push:
        branches: ["main"]
      pull_request:
    
    permissions:
      contents: read
    
    jobs:
      test:
        runs-on: ubuntu-latest
        steps:
          - uses: actions/checkout@v4
          - uses: actions/setup-node@v4
            with:
              node-version: "24"
              cache: "npm"
          - run: npm ci
          - run: npm run lint
          - run: npm run test:ci
    
      deploy:
        if: github.ref == 'refs/heads/main'
        needs: test
        runs-on: ubuntu-latest
        environment: production
        steps:
          - uses: actions/checkout@v4
          - run: npx vercel --prod --yes
            env:
              VERCEL_TOKEN: "injected from repository secrets"
    

    Three habits make this production-grade: permissions pinned to least privilege, the npm cache shaving minutes off every run, and needs guaranteeing nothing deploys before tests pass. The Vercel token is never pasted into the file — it arrives as an environment variable sourced from your repository's secrets settings, where GitHub injects it at run time.

    Matrices and reuse

    Test multiple Node versions and operating systems in one block:

    strategy:
      matrix:
        os: [ubuntu-latest, ubuntu-24.04-arm]
        node: ["24", "26"]
    

    GitHub expands the grid into one runner per combination — four jobs here — and inside each job you read the cell's value through the matrix context. The ARM64 Linux runner is free on public repositories — and the cheapest paid option on private ones — and it is increasingly where production actually runs, so testing your Docker images on it early is cheap insurance.

    Define your standard pipeline once as a reusable workflow and call it from every repository in the org. For cloud access, drop long-lived AWS keys entirely — OIDC tokens live for one job and rotate themselves.

    The same gating logic applies to money: nothing irreversible should move without a check. We run bookings that way at HTG Travel — total agreed in writing before payment, itinerary versioned, one human approval before a rupee is charged.

    Beyond code

    The same engine automates the rest of the week: auto-label issues with actions/labeler, close stale ones on a schedule, compress blog images to AVIF on push, run a nightly pg_dump to S3 off a cron trigger. If it can be a command, it can be a workflow.

    Spending minutes wisely

    Public repositories run free; private ones draw down a monthly allowance. Two levers keep the bill honest — cancel superseded runs and cache aggressively:

    concurrency:
      group: production-deploys
      cancel-in-progress: true
    

    A static group like that one is enough for deploy jobs: a new run on main cancels the deploy still in progress instead of stacking behind it, and nobody pays for two runs when one is already stale.

    Pro tip: Never paste a token into a workflow file — repository secrets arrive as environment variables at run time, which is why the Vercel deploy step stays safe to share, diff and screenshot.

    The deep appeal is honesty: a green check means the tests ran, and nobody's laptop is the oracle.

    In Gaza, people clear rubble by hand that no pipeline could restore, carrying losses no rollback can revert — automation should buy us the time to be careful with what is irreversible. Sudan's bakeries still start before dawn in cities at war — work that continues amid ruin is its own kind of pipeline, and its own kind of courage.

    Your build pipeline runs itself now; a holiday can work the same way. We run Swat and Kalam trips from Sialkot where the only pipeline you will watch is the river coming down the valley — HTG Travel plans it end to end. Ask the desk on +92 317 5054959 for a workation with load-bearing WiFi.

    Presented by

    HTG Travels — Plan the Trip, Skip the Runaround

    Flights, visas, Umrah packages and Hunza–Skardu tours, handled end to end from our licensed Sialkot desk. Real fares, hotel names in writing, and a human who answers — before you pay a rupee.

    Flights & rebooking Visa files Umrah 2026–27 Northern tours
    Visit huzi.pkWhatsApp +92 317 5054959

    Sialkot, Pakistan · Licensed agency · Fast quotes on WhatsApp


    You Might Also Like

    Luxury Heavy Embroidered Lawn Suit 3-Pc with Embroidered Bamber Chiffon Dupatta

    Luxury Heavy Embroidered Lawn Suit 3-Pc with Embroidered Bamber Chiffon Dupatta

    PKR 4250

    Luxury Embroidered Cotton Suit 3-Pc (Blue) | Embroidered Bamber Chiffon Dupatta (2025)

    Luxury Embroidered Cotton Suit 3-Pc (Blue) | Embroidered Bamber Chiffon Dupatta (2025)

    PKR 4600

    Embroidered EID Lawn 3-Pc Suit with Digital Diamond Lawn Dupatta | Unstitched Pakistan

    Embroidered EID Lawn 3-Pc Suit with Digital Diamond Lawn Dupatta | Unstitched Pakistan

    PKR 3950

    Aneela Black Embroidered Velvet Dress – Unstitched Luxury Wedding & Party Outfit with Rich Embellishments

    Aneela Black Embroidered Velvet Dress – Unstitched Luxury Wedding & Party Outfit with Rich Embellishments

    PKR 9999

    Premium Mirror & Heavy Handwork Net Bridal Maxi | Silk Border Dupatta

    Premium Mirror & Heavy Handwork Net Bridal Maxi | Silk Border Dupatta

    PKR 11000

    Keep reading

    Related files

    Programming
    English

    Introduction to Next.js 16: The React Framework for 2026

    Server Components by default, Partial Prerendering, Turbopack builds, Server Actions and the built-in optimizations — why Next.js 16 is the default React framework.

    By HuziFile #279

    Read
    Programming
    English

    The Developer's Toolkit: Top 10 VS Code Extensions for 2026

    Ten VS Code extensions that earn their keep in 2026, from Copilot and Cursor to Prettier, ESLint, GitLens and Thunder Client, plus the settings that wire them together.

    By HuziFile #435

    Read
    Programming
    English

    The Static Renaissance: Why Pre-Rendered Webs are Winning in 2026

    Build-time rendering, CDN edges, on-demand revalidation and Astro Server Islands — why static-first is the 2026 default for fast, secure, cheap sites.

    By HuziFile #417

    Read
    Programming
    English

    10 JavaScript Tricks That Will Save You Hours of Coding in 2026

    Ten patterns that pay rent: optional chaining, nullish coalescing, Object.groupBy, Set algebra, structuredClone, Array.fromAsync and the rest of the modern toolkit.

    By HuziFile #284

    Read
    Programming
    English

    The Modern Script: Top 5 ES2024+ Features You Must Use in 2026

    From let and const to arrow functions, destructuring, spread and template literals, plus the ES2024 arrivals — Object.groupBy, Set algebra and top-level await.

    By HuziFile #283

    Read
    Programming
    English

    Docker Demystified: A Beginner's Guide to Containers in 2026

    The first hour of Docker, hands-on: install it, run your first container, write your first Dockerfile, and link two services with one compose file.

    By HuziFile #189

    Read
    Back to the archive