What is a CI/CD pipeline for a Node.js application, and what stages does a typical one include?
Short answer
A typical pipeline includes: installing dependencies, running linters/type checks, running the test suite, building a production artifact (a Docker image), and deploying it to staging then production, often with manual approval gates or automated canary/blue-green rollout…
Advertisement
AModel answer
A typical pipeline includes: installing dependencies, running linters/type checks, running the test suite, building a production artifact (a Docker image), and deploying it to staging then production, often with manual approval gates or automated canary/blue-green rollout strategies for production.
name: CI
on: [push]
jobs:
test:
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- run: npm ci
- run: npm run lint
- run: npm test
- run: docker build -t myapp:${{ github.sha }} .Real-world example
A team's pipeline runs the full test suite and builds a Docker image on every pull request, blocking merges until tests pass, and auto-deploys to staging on merge with a manual approval step for production.
Likely follow-ups
- What's the difference between continuous delivery and continuous deployment, given both are abbreviated CD?
- How would you add a rollback mechanism in case a deployed change causes issues?
Related topics