← Back|CLOUD-DEVOPSSection 1/16
0 of 16 completed

CI/CD basics

Beginner13 min read📅 Updated: 2026-02-17

Introduction

Nee code change pannina, manually build pannuva, manually test pannuva, manually deploy pannuva — ivlo effort! Oru typo fix panna kuda 30 minutes aagum. 😩


CI/CD vandha — code push pannina automatically build, test, deploy ellam nadakkum. Nee code la focus pannuva, baaki ellam automation paathukum!


Indha article la CI/CD fundamentals, GitHub Actions pipeline build pannradhu, AI project ku CI/CD setup — ellam hands-on ah paapom! ⚙️🚀

Continuous Integration (CI) Explained

Continuous Integration (CI) = Every code change automatic ah integrate, build, and test aagum.


Without CI 😰:

  1. Developer A — feature build panni 2 weeks la push
  2. Developer B — another feature build panni 2 weeks la push
  3. Merge conflicts! Bugs! 3 days fix panna pogudhu

With CI 😊:

  1. Developer A — small change push → auto build + test → ✅ pass
  2. Developer B — small change push → auto build + test → ✅ pass
  3. No conflicts! No surprises! Continuous ah integrate aagudhu

CI process:

code
Code Push → Trigger Build → Run Tests → Report Results
    │            │              │            │
  Git push   Compile/Build   Unit tests   ✅ Pass / ❌ Fail
             Docker build    Lint check    Notification
                             Type check

Rule: Never push directly to main branch. Always use Pull Requests with CI checks! 🛡️

Continuous Delivery vs Deployment

CD has two meanings:


Continuous Delivery 📦:

  • Code always ready to deploy
  • But human manually approves deployment
  • "Push button deploy" — one click deploy
  • Best for: Sensitive apps (banking, healthcare)

Continuous Deployment 🚀:

  • Code automatically deploys to production
  • No human approval needed
  • Every passing commit goes live
  • Best for: Fast-moving apps, AI apps

AspectContinuous DeliveryContinuous Deployment
Auto deploy?❌ Manual approval✅ Fully automatic
RiskLowerHigher
SpeedFastFastest
Best forEnterprise, regulatedStartups, AI apps

AI apps ku recommendation: Continuous Deployment with canary releases — small percentage users ku first deploy, problems illana full rollout. 🎯

CI/CD Pipeline Architecture

🏗️ Architecture Diagram
┌─────────────────────────────────────────────────┐
│              CI/CD PIPELINE FLOW                  │
├─────────────────────────────────────────────────┤
│                                                   │
│  👨‍💻 Developer                                     │
│    │                                              │
│    ▼ git push                                     │
│  ┌──────────┐                                    │
│  │  GitHub   │──── Webhook Trigger               │
│  └──────────┘         │                          │
│                  ┌────▼────┐                      │
│        ┌─────── │   CI    │ ───────┐             │
│        │        │ Server  │        │             │
│        ▼        └─────────┘        ▼             │
│   ┌────────┐   ┌────────┐   ┌────────┐         │
│   │ Build  │──▶│  Test  │──▶│  Lint  │         │
│   └────────┘   └────────┘   └────────┘         │
│        │            │            │               │
│        └────────────┼────────────┘               │
│              ┌──────▼──────┐                     │
│              │ Docker Build│                     │
│              └──────┬──────┘                     │
│              ┌──────▼──────┐                     │
│              │   Deploy    │                     │
│              ├─────────────┤                     │
│              │ Staging ──▶ │                     │
│              │ QA ──────▶  │                     │
│              │ Production  │                     │
│              └─────────────┘                     │
│                                                   │
└─────────────────────────────────────────────────┘

GitHub Actions — Hands-On

GitHub Actions — most popular free CI/CD tool! 🎉


Why GitHub Actions?

  • GitHub la direct ah integrated
  • Free for public repos (unlimited)
  • Private repos: 2000 min/month free
  • YAML config — simple syntax
  • Marketplace: 15,000+ pre-built actions

Basic concepts:

  • Workflow = CI/CD pipeline definition (.yml file)
  • Job = Set of steps that run on same runner
  • Step = Individual task (checkout, build, test)
  • Runner = Server that executes the job
  • Trigger = Event that starts workflow (push, PR, schedule)

Folder structure:

code
.github/
  workflows/
    ci.yml        ← CI pipeline
    deploy.yml    ← CD pipeline
    test.yml      ← Test pipeline

Every .yml file = one workflow. Multiple workflows parallel ah run aagum! ⚡

Your First CI Pipeline

Example

Basic CI pipeline for AI Python project:

yaml
# .github/workflows/ci.yml
name: CI Pipeline

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

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-python@v5
        with:
          python-version: '3.11'
      - run: pip install -r requirements.txt
      - run: python -m pytest tests/
      - run: python -m flake8 src/

  build:
    needs: test
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: docker build -t my-ai-app .

Explained:

- Push or PR to main → trigger

- First job: Install deps, run tests, lint

- Second job: Build Docker image (only if tests pass)

Copy paste pannunga, modify pannunga — unga first pipeline ready! 🎯

AI Project CI/CD Extras

AI projects ku standard CI/CD plus extra checks venum:


1. Model Accuracy Check 🎯

yaml
- name: Test model accuracy
  run: |
    python test_model.py
    # Fails if accuracy < 95%

2. Model Size Check 📦

yaml
- name: Check model size
  run: |
    SIZE=$(du -m model.onnx | cut -f1)
    if [ $SIZE -gt 500 ]; then exit 1; fi

3. Data Validation 📊

yaml
- name: Validate training data
  run: python validate_data.py

4. API Response Check 🔍

yaml
- name: Test API endpoint
  run: |
    python -m pytest tests/api/
    # Test response format, latency

5. Model Version Tag 🏷️

yaml
- name: Tag model version
  run: |
    echo "MODEL_V=v$(date +%Y%m%d)" >> $GITHUB_ENV

Ivanga add pannina, AI-specific bugs early ah catch aagum! 🛡️

CI/CD Tools Comparison

Popular CI/CD tools compare:


ToolFree TierHostingDifficultyBest For
GitHub Actions2000 min/moCloudEasyGitHub users
GitLab CI400 min/moCloud/SelfMediumGitLab users
JenkinsUnlimitedSelf-hostedHardEnterprise
CircleCI6000 min/moCloudMediumSpeed
Travis CILimitedCloudEasyOpen source
Azure Pipelines1800 min/moCloudMediumAzure users

My recommendation:

  • 🥇 GitHub Actions — Beginners, most projects
  • 🥈 GitLab CI — GitLab users, self-hosted option
  • 🥉 Jenkins — Enterprise, maximum customization

Pro tip: Start with GitHub Actions. 90% projects ku ivlo podhum. Jenkins learn pannunga for interviews! 💼

CI/CD Best Practices

CI/CD pipeline effective ah irukka follow pannunga:


1. Fast Feedback

  • Pipeline 10 min ku ulla complete aaganum
  • Slow tests parallel ah run pannunga
  • Cache dependencies (pip cache, Docker layer cache)

2. Branch Protection 🛡️

  • Main branch ku direct push block pannunga
  • PR mandatory, CI pass mandatory
  • Minimum 1 reviewer approval

3. Environment Strategy 🌍

  • Dev → Staging → Production
  • Each environment separate config
  • Production deploy only from main branch

4. Secrets Management 🔒

  • API keys GitHub Secrets la store pannunga
  • Never hardcode in YAML files
  • Rotate secrets regularly

5. Notifications 🔔

  • Slack/Teams notification on failure
  • Email on deployment success
  • Dashboard for pipeline status

6. Rollback Plan ↩️

  • Every deploy rollback possible ah irukanum
  • Previous version Docker image keep pannunga
  • One-click rollback setup pannunga

Common CI/CD Mistakes

⚠️ Warning

Beginners make pannra mistakes:

No tests — CI pipeline irukku but tests illa. Useless!

Too slow — 30+ min pipeline. Developers frustrated aagiduvaanga

Ignoring failures — "CI failed but I'll merge anyway" — NEVER do this!

Hardcoded secrets — API keys YAML la or code la — security risk

No caching — Every run full install from scratch — waste time

Complex pipeline — Over-engineered. Start simple, grow gradually

No rollback — Deploy failed but previous version ku poga mudiyaadhu

Skipping staging — Direct to production deploy — risky!

Golden rule: If CI fails, STOP. Fix it first. Don't accumulate broken builds. 🛑

Deployment Strategies

Production deploy panna different strategies:


1. Rolling Deployment 🔄

  • Old servers one-by-one replace pannradhu
  • Zero downtime
  • Slow rollout

2. Blue-Green Deployment 🔵🟢

  • Two identical environments
  • Blue = current, Green = new
  • Traffic switch pannradhu
  • Instant rollback possible

3. Canary Deployment 🐤

  • 5% traffic new version ku route
  • Monitor pannunga
  • Issues illana 100% ku rollout
  • Best for AI apps — model performance test

4. A/B Deployment 🅰️🅱️

  • Different versions different users ku
  • Performance compare pannunga
  • Data-driven decision

AI apps ku best: Canary deployment — new model 5% users ku serve pannunga, accuracy monitor pannunga, ok na full rollout. 🎯

Prompt: Create CI/CD Pipeline

📋 Copy-Paste Prompt
You are a DevOps engineer.

Create a complete GitHub Actions CI/CD pipeline for:
- Python FastAPI AI application
- Uses a HuggingFace sentiment analysis model
- Docker containerized
- Deploy to Google Cloud Run
- Include: linting, testing, Docker build, deploy

Provide:
1. Complete .github/workflows/ci-cd.yml file
2. Dockerfile
3. Test file structure
4. Secrets needed (and how to add them)
5. Rollback procedure

Summary

Key takeaways:


CI = Auto build & test on every code push

CD = Auto deploy to staging/production

GitHub Actions = Best free CI/CD tool for beginners

AI extras = Model accuracy, size, data validation checks

Best practices = Fast pipeline, branch protection, secrets management

Deploy strategies = Canary best for AI apps


Action item: Innaiku oru simple GitHub repo create pannunga, GitHub Actions CI pipeline add pannunga. 30 minutes dhaan aagum — but career ku massive impact! 💪


Next article: Docker for AI Apps — containerization deep dive! 🐳

🏁 🎮 Mini Challenge

Challenge: Build Complete CI/CD Pipeline GitHub Actions


Real-world CI/CD pipeline setup — AI model inference app:


Step 1: AI Inference App Create Pannunga 🤖

python
# app.py — FastAPI, ML model load, prediction endpoint
from fastapi import FastAPI
from transformers import pipeline

app = FastAPI()
classifier = pipeline("zero-shot-classification",
                      model="facebook/bart-large-mnli")

@app.post("/predict")
def predict(text: str, labels: list):
    result = classifier(text, labels)
    return result

Step 2: Unit Tests Write Pannunga

bash
# tests/test_app.py
# Test inference, test edge cases, test error handling

Step 3: GitHub Actions Workflow Setup ⚙️

yaml
# .github/workflows/cicd.yml
# 1. Trigger: push to main
# 2. Test step: pytest run
# 3. Build step: Docker image build
# 4. Push step: Docker Hub/GitHub Container Registry push
# 5. Deploy step: Cloud Run, AWS, or similar

Step 4: Secrets Configure Pannunga 🔐

bash
# GitHub Settings → Secrets
# DOCKER_HUB_TOKEN, DOCKER_HUB_USERNAME add
# CLOUD_CREDENTIALS (GCP/AWS) add

Step 5: Git Push & Monitor 🚀

bash
# git add .
# git commit -m "Add full CI/CD pipeline"
# git push
# Actions tab → workflow execution watch
# Each step logged, detailed results available

Step 6: Slack/Email Notification 💬

yaml
# Workflow status change pa notification receive
# Success → celebrate, Failure → alert

Completion Time: 2-3 hours

Tools: GitHub Actions, Docker, FastAPI, pytest

Real-world applicable

💼 Interview Questions

Q1: Jenkins vs GitHub Actions vs GitLab CI — best choice?

A: Jenkins = self-hosted, powerful, learning curve high. GitHub Actions = GitHub native, easy, generous free tier. GitLab CI = GitLab native, good pipeline. Recommendation: GitHub Actions for startups/teams (GitHub already use), Jenkins for large enterprises (legacy systems).


Q2: Pipeline fail -> production deploy block — epdhi setup?

A: Branch protection rules: main la merge pannradhu, CI checks pass venum. Pull request required, code review required. Pipeline fail → automatic PR block. Manual override possible (admin-level). This ensures quality gate — bad code production la vappadhu illa.


Q3: Artifact vs Container — CI/CD la difference?

A: Artifact = build output (JAR, compiled binary, reports). Container = complete environment (code + dependencies + runtime). Containers better for scaling, consistency. Artifacts faster to generate. Modern practices: artifact generate, container build from artifact, registry push.


Q4: Pipeline optimization — slow runners problem?

A: Parallel jobs run (multiple tests parallel). Cache use (dependencies download, don't re-download). Smaller images (multi-stage Docker builds). Matrix strategy (multiple environments test simultaneously). Timeouts set (hung jobs kill). Critical metric = full pipeline execution time <5 minutes ideal.


Q5: Feature flags + CI/CD — why important?

A: Feature flags = feature control without code change. Deploy incomplete features → flag off (users see illa). Testing easy (flag on during testing). Gradual rollout (5% users → 50% → 100%). Rollback instant (no deployment needed, just toggle). Production deployment frequent (confidence high), but feature release controlled.

Frequently Asked Questions

CI/CD na enna simple ah?
CI (Continuous Integration) = Code changes auto build & test. CD (Continuous Delivery/Deployment) = Tested code auto deploy to production. Together they automate the entire software delivery process.
Best CI/CD tool evadhu?
GitHub Actions — free, easy, GitHub la integrated. Jenkins — powerful but complex. GitLab CI — GitLab users ku best. Beginners ku GitHub Actions recommend pannuven.
CI/CD learn panna yevlo time aagum?
Basic CI/CD pipeline — 1-2 days. Advanced (multi-stage, environments, secrets) — 1-2 weeks. Mastery with real projects — 1-2 months.
AI projects ku CI/CD different ah?
Yes, slightly. AI projects ku model testing (accuracy checks), data validation, model size checks, and model versioning — extra steps add pannanum CI/CD la.
🧠Knowledge Check
Quiz 1 of 1

Canary deployment na enna?

0 of 1 answered