CI/CD & DevOps

What Is CI/CD and Why It Matters

Understand continuous integration and deployment — the automation that lets teams ship confidently every day.

CI/CD Defined

CI (Continuous Integration) — Automatically build, lint, and test code every time a developer pushes changes. The goal: find problems immediately, before they compound.

CD (Continuous Delivery) — Automatically deploy to staging after CI passes. The code is always in a deployable state; deployment to production requires a manual trigger.

CD (Continuous Deployment) — Automatically deploy to production after all tests pass. No human required between commit and production. This requires very high test confidence and is not appropriate for every team.

The Pipeline

A CI/CD pipeline is the sequence of automated steps that code passes through on its way from a developer's commit to running in production:

  1. Developer pushes code to a branch
  2. CI pipeline triggers automatically
  3. Linter runs (catches style and obvious code issues)
  4. Type checker runs (TypeScript ensures type correctness)
  5. Unit tests run
  6. Integration tests run
  7. Application builds
  8. Artifact deployed to staging automatically
  9. (Optional) Manual review of staging
  10. Deployment to production (manual trigger or automatic)

If any step fails, the pipeline stops. The developer is notified immediately.

Why CI/CD Matters

Catches bugs before production. Without CI/CD, bugs are found by users. With CI/CD, they are found by automated tests seconds after the code is written.

Enforces quality standards. The linter and type checker run on every push — there is no way to merge code that violates the standards.

Eliminates "works on my machine." The CI environment is the same every time. If it passes in CI, it runs in production.

Enables rapid iteration. When deployment is safe and automated, developers can ship multiple times per day. Manual deployment processes create fear and infrequent releases.

The Cultural Shift

CI/CD represents a fundamental change in how teams think about deployment:

Before CI/CD: Deploy on Fridays (so the weekend is a buffer), deploy rarely (each deployment is risky and manual), deployment is the responsibility of one "ops person."

After CI/CD: Deploy whenever code is ready, deploy many times per day, every developer is responsible for the deployability of their own code.

CI/CD Platforms

PlatformBest ForFree Tier
GitHub ActionsGitHub repositoriesGenerous — 2000 min/month
VercelNext.js / frontendFree for hobby projects
NetlifyJamstack / static sitesFree for hobby projects
GitLab CIGitLab repositoriesAvailable
CircleCIComplex pipelinesLimited

For most Next.js projects, the answer is GitHub Actions + Vercel: GitHub Actions for tests, Vercel for deployment.

Key Takeaways

  • CI automatically runs tests on every push; CD automatically deploys passing code to staging or production
  • A pipeline is the sequence: lint → typecheck → test → build → deploy to staging → deploy to production
  • CI/CD shifts deployment from a risky, infrequent event to a safe, routine operation
  • CI/CD is only as good as the tests — invest in the Testing pillar to maximize pipeline confidence
  • GitHub Actions + Vercel is the practical recommendation for Next.js applications

Example

yaml
# Minimal CI/CD pipeline visualization
# .github/workflows/ci.yml

name: CI

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

jobs:
  quality:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: '20'
          cache: 'npm'
      - run: npm ci
      - run: npm run lint        # Step 1: Lint
      - run: npm run typecheck   # Step 2: Type check
      - run: npm test            # Step 3: Tests
      - run: npm run build       # Step 4: Build
Try it yourself — YAML

Docker, AWS, Vercel, Netlify, GitHub, GitHub Actions are trademarks of Docker, Inc., Amazon.com, Inc., Vercel, Inc., Netlify, Inc., Microsoft Corporation. DevForge Academy is not affiliated with, endorsed by, or sponsored by these companies. Referenced for educational purposes only. See full disclaimers