惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园_首页
大猫的无限游戏
大猫的无限游戏
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Apple Machine Learning Research
Apple Machine Learning Research
B
Blog
B
Blog RSS Feed
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
P
Proofpoint News Feed
MyScale Blog
MyScale Blog
Engineering at Meta
Engineering at Meta
量子位
H
Hackread – Cybersecurity News, Data Breaches, AI and More
T
Tailwind CSS Blog
Stack Overflow Blog
Stack Overflow Blog
N
Netflix TechBlog - Medium
T
The Blog of Author Tim Ferriss
U
Unit 42
aimingoo的专栏
aimingoo的专栏
博客园 - 叶小钗
博客园 - 【当耐特】
云风的 BLOG
云风的 BLOG
博客园 - Franky
博客园 - 聂微东

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
Stop Deploying Manually: How to Build Your First CI/CD Pi...
Atul Vishwakarma · 2026-06-15 · via DEV Community

Atul Vishwakarma

If you are still manually running tests and deploying your code from your local terminal, you are wasting valuable time.

When I first started diving into DevOps and Cloud engineering, the concept of CI/CD (Continuous Integration / Continuous Deployment) felt incredibly intimidating. I thought I needed a complex Jenkins server or a massive AWS architecture just to automate my workflows.

It turns out, if your code is already on GitHub, you can build your first automated pipeline in under 10 minutes using GitHub Actions.

Today, I’ll show you exactly how to set up a basic workflow that automatically tests your code every time you push to your repository.

Prerequisites:

  • A GitHub account
  • A basic understanding of Git (git add, git commit, git push)
  • A sample project (we will use a simple Node.js project for this example, but the concepts apply to any language).

Step 1: Create Your Workflow File

GitHub Actions looks for a very specific folder structure in your repository to know what to run.

In the root directory of your project, create a new folder called .github, and inside that, create a folder called workflows. Finally, create a YAML file inside it. You can name it whatever you want, but ci.yml is standard.

Your path should look like this: .github/workflows/ci.yml

Step 2: Write the YAML Configuration

YAML is the language of DevOps. It relies heavily on indentation, so make sure your spacing is exact!

Open your ci.yml file and paste the following code:

name: Node.js CI Pipeline

# 1. When should this workflow run?
on:
  push:
    branches: [ "main" ]
  pull_request:
    branches: [ "main" ]

# 2. What jobs should it execute?
jobs:
  build-and-test:
    # We need a virtual machine to run our code
    runs-on: ubuntu-latest

    # 3. What are the exact steps?
    steps:
    # Step A: Check out the code from our repository
    - name: Checkout code
      uses: actions/checkout@v3

    # Step B: Set up the Node.js environment
    - name: Setup Node.js
      uses: actions/setup-node@v3
      with:
        node-version: '18.x'

    # Step C: Install dependencies
    - name: Install Dependencies
      run: npm ci

    # Step D: Run our tests
    - name: Run Tests
      run: npm test

Breaking Down the Code:

  • on: This tells GitHub exactly when to trigger the pipeline. In our case, it runs every time someone pushes code or opens a pull request to the main branch.

  • runs-on: GitHub provisions a fresh, temporary Ubuntu server (a runner) specifically to execute your commands.

  • steps: This is the chronological list of commands. We check out the code, install Node.js, install our npm packages, and finally, run the tests.

Step 3: Push and Watch the Magic

Save your file, commit it, and push it to GitHub:

git add .github/workflows/ci.yml
git commit -m "chore: add github actions CI pipeline"
git push origin main

Now, navigate to your repository on GitHub and click the "Actions" tab at the top.

You will see your workflow running in real-time! If your tests pass, you will get a satisfying green checkmark ✅. If they fail, you will get a red X and a log detailing exactly what broke, preventing bad code from making it to production.

The Takeaway

Congratulations! You just implemented Continuous Integration.

This is the foundational building block of modern DevOps. From here, you can expand this exact same file to automatically push Docker images to AWS, trigger serverless deployments, or send a Slack message when a build fails.

Automation is about letting the machines do the repetitive work so you can focus on building cool things.

I'll be sharing more DevOps and Cloud tutorials here as I build and learn. If this tutorial saved you some time, you can ☕ buy me a coffee here to support my work!