CI/CD Pipelines — Complete Guide
CI/CD Pipelines — Complete Guide: free step-by-step lesson with examples, common mistakes, and interview tips — part of React.js Tutorial on Toolliyo Academy.
On this page
React.js Tutorial · Lesson 90 of 100
CI/CD Pipelines
Beginner ✓ → Intermediate ✓ → Advanced ✓ → Professional
Professional · 4 — ShopCart projects · ~25 min read · Module 9: Testing & Deployment
Introduction
Professional project lesson: CI/CD Pipelines. You will put together routing, data, and UI like a portfolio app. Build one piece at a time — do not rush. CI/CD automatically runs lint, test, and build on every push — then deploys passing builds to staging or production. Manual deploys skip tests and break production. Pipeline enforces quality gates.
A app on your laptop is not finished until it runs somewhere others can open a URL.
When will you use this?
Use when you are ready to put the app online for users or employers to see.
- Shipping means tests pass, build succeeds, and Docker or Azure hosts the static files.
- Companies run CI so broken code never reaches users.
Real-world: PR gate pipeline
Every pull request runs lint, unit tests, build, and Playwright smoke — merge blocked on failure.
Production-style code
# .github/workflows/pr.yml
jobs:
verify:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: npm ci
- run: npm run lint
- run: npm test -- --ci
- run: npm run build
- run: npx playwright test --grep @smoke
What happens in production: Broken main branch becomes rare — team ships React features with confidence.
Lesson example (start here)
Copy this smaller example first. Once it works, compare it with the real-world code above.
# .github/workflows/ci.yml
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: npm ci
- run: npm run lint
- run: npm test
- run: npm run build
Line-by-line walkthrough
| Code | What it means |
|---|---|
# .github/workflows/ci.yml | Comment — notes for humans; the computer ignores it. |
on: [push] | Part of the CI/CD Pipelines example — read it together with the lines before and after. |
jobs: | Part of the CI/CD Pipelines example — read it together with the lines before and after. |
build: | Part of the CI/CD Pipelines example — read it together with the lines before and after. |
runs-on: ubuntu-latest | Part of the CI/CD Pipelines example — read it together with the lines before and after. |
steps: | Part of the CI/CD Pipelines example — read it together with the lines before and after. |
- uses: actions/checkout@v4 | Part of the CI/CD Pipelines example — read it together with the lines before and after. |
- run: npm ci | Part of the CI/CD Pipelines example — read it together with the lines before and after. |
- run: npm run lint | Part of the CI/CD Pipelines example — read it together with the lines before and after. |
- run: npm test | Part of the CI/CD Pipelines example — read it together with the lines before and after. |
- run: npm run build | Part of the CI/CD Pipelines example — read it together with the lines before and after. |
How it works (big picture)
- Every push runs the same checks.
- Fail fast on lint or test errors.
- Deploy job runs only after build succeeds.
Do this on your computer
- Add GitHub Actions workflow file.
- Fix lint/test until pipeline green.
- Add deploy step with secrets for hosting.
- Read the real-world section and name which part of the app uses this topic.
- Run the example locally and confirm the same behavior in the browser.
- Change one value in the example (text, initial state, or URL) and predict what will happen before you save.
Experiments — try changing this
- Change text or labels in the example and save — watch the browser update.
- Break the code on purpose (remove a bracket), read the error message, then fix it.
Remember
CI = auto lint + test + build. CD = auto deploy on success. Start with GitHub Actions.
Common questions
CI for solo dev?
Still valuable — catches breaks before users see them.
How long should I spend on CI/CD Pipelines?
Until you can explain it in your own words and run the example without looking at the answer. Beginners often need 30–60 minutes per new hook or routing topic; setup lessons may take one afternoon.
What if I get stuck on CI/CD Pipelines?
Re-read the line-by-line walkthrough, check the browser console for red errors, and compare your code character-by-character with the example. Search the exact error text — someone else had it too.
Where is CI/CD Pipelines used in real jobs?
See the real-world section above — the same pattern appears in LMS, banking, e-commerce, and SaaS products. Interviewers ask you to explain it using one concrete example from your project or this lesson.
Sign in to ask a question or upvote helpful answers.
No questions yet — be the first to ask!