categories.delivery-automation Basic

What are the key stages of a CI/CD pipeline? What is the difference between CI and CD?

AI Practice

CI vs CD

Continuous Integration (CI) Developers frequently merge code to the main branch; each merge automatically triggers a build and tests to catch problems early.

Continuous Delivery Builds on CI — ensures the software is always in a deployable state, but deployment requires manual triggering.

Continuous Deployment Goes further — automatically deploys to production after all automated tests pass, with no human intervention.

Typical CI/CD Pipeline Stages

  1. Source: Code push or PR triggers the pipeline
  2. Build: Compile, package, create Docker image
  3. Unit Test: Fast unit tests (seconds)
  4. Integration Test: Integration tests (minutes)
  5. Security Scan: SAST static analysis, dependency vulnerability scanning
  6. Push Artifact: Push image to Container Registry
  7. Deploy to Staging: Deploy to test environment
  8. E2E Test: End-to-end tests
  9. Deploy to Production: Deploy to production (manual or automatic)

GitHub Actions Example Snippet

on: push: branches: [main] jobs: test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - run: npm ci - run: npm test

Fail Fast Principle

Put the fastest tests first (unit tests before integration tests) so developers get feedback quickly — avoiding the need to wait for slow E2E tests before discovering basic issues.

✦ AI Mock Interview

Type your answer and get instant AI feedback

Sign in to use AI scoring

Copyright © 2026 Wood All Rights Reserved · FE Interview Hub