MSK Institute LogoMSK.Institute
HomeCourses
Book Free Demo➔Sign In
Free Demo➔
MSK Institute LogoMSK.Institute

Leading computer training academy in Shikohabad for software engineering, Python, web development, and digital literacy.

ISO 9001:2015 Certified Center
Follow & Connect
4.9

Programs & Admissions

  • All CoursesCatalog
  • Learning PathsRoadmaps
  • Student ProjectsShowcase
  • Live Classes & ScheduleLive
  • Upcoming Batches
  • Campuses & LocationsHub
  • Verify Certificates
  • Book Free Demo Class

Resources & Tools

  • Free Online Mock TestsAll Tests
  • NIELIT CCC Mock TestFree
  • Course & Career FinderQuiz
  • Study Material Hub
  • All MSK ToolsHub
  • Keyboard ShortcutsNew
  • TypeQuest Speed LabTyping
  • MSK Code PlaygroundCode
  • Interactive Tutorials
  • Quick Cheatsheets

Institute & Contact

  • About MSK Institute
  • Careers & InternshipsHiring
  • Publications & Blogs
  • Gali No. 3, Near Gyan Jyoti Public School,
    Adarsh Nagar, Shikohabad, Uttar Pradesh 283135
  • +91 83930 42166
  • mskshikohabad@gmail.com
  • Hours:Mon – Sat: 8:00 AM – 7:00 PM | Sun: 10:00 AM – 2:00 PM
  • 4.9 ★(38 Google Reviews)
© 2026 MSK Institute. All rights reserved.•Privacy Policy•Terms of Service•Disclaimer•Contact Us

Shikohabad's Leading Computer & Coding Academy

Home
Courses
Live
Material
Automated CI/CD Pipelines with GitHub Actions0%
Study Materials
React.js for AdvancedProgress 0%
1.1Control Props and Inversion of Control Pattern1.2State Reducer Pattern in Advanced React1.3Prop Getters and Flexible Design Systems1.4Headless UI Architecture and Accessibility Primitives
17.1Production Build Optimization and Asset Compression17.2Dockerizing React Applications with Multi-Stage Builds17.3Automated CI/CD Pipelines with GitHub Actions17.4Edge CDN Deployment with Cloudflare, Vercel, and Netlify
HomeTutorialsReact.js for AdvancedAutomated CI/CD Pipelines with GitHub Actions
Edge CDN Deployment with Cloudflare, Vercel, and Netlify

Automated CI/CD Pipelines with GitHub Actions

Beginner12 min read•Updated: 2026-11-18•By Er. Sumit Kumar (MSK Institute)
Study MaterialsCheatsheet

Enterprise engineering organizations require continuous confidence that code merged into main repositories compiles without type errors, satisfies linting rules, passes test suites, and deploys reliably. GitHub Actions automates this lifecycle via Continuous Integration (CI) and Continuous Deployment (CD) pipelines triggered on pull requests and branch merges.


1. Enterprise CI/CD Pipeline Architecture

1Developer opens Pull Request
2 │
3 ▼
4GitHub Actions CI Pipeline (Triggers in Parallel):
5┌─────────────────────────┬─────────────────────────┬─────────────────────────┐
6│ 1. Lint & Format │ 2. Type Check │ 3. Automated Tests │
7│ (ESLint + Prettier) │ (tsc --noEmit) │ (Vitest + RTL) │
8└─────────────────────────┴─────────────────────────┴─────────────────────────┘
9 │
10 All Checks Pass? ✅
11 │
12 ▼
13Pull Request Merged to 'main' ──► CD Pipeline ──► Production Build ──► Deploy to CDN

2. Complete CI Workflow (.github/workflows/ci.yml)

1name: Continuous Integration
2 
3on:
4 pull_request:
5 branches: [main, staging]
6 push:
7 branches: [main]
8 
9jobs:
10 validate:
11 name: Lint, Typecheck, and Test
12 runs-on: ubuntu-latest
13 
14 steps:
15 # 1. Check out repository code
16 - name: Checkout Code
17 uses: actions/checkout@v4
18 
19 # 2. Setup Node.js with caching
20 - name: Setup Node.js 20
21 uses: actions/setup-node@v4
22 with:
23 node-version: 20
24 cache: "npm"
25 
26 # 3. Deterministic Dependency Installation
27 - name: Install Dependencies
28 run: npm ci
29 
30 # 4. Lint Verification
31 - name: Run ESLint
32 run: npm run lint
33 
34 # 5. TypeScript Strict Type Checking
35 - name: Type Check (No Emit)
36 run: npx tsc --noEmit
37 
38 # 6. Run Unit and Integration Tests with Coverage
39 - name: Run Vitest Suite
40 run: npm run test:coverage
41 
42 # 7. Verify Production Build Compiles
43 - name: Build Production Bundle
44 run: npm run build

3. Continuous Deployment (CD) Workflow (.github/workflows/cd.yml)

Deploy compiled assets securely to cloud providers (AWS S3 + CloudFront, Vercel, or Cloudflare Pages) using OpenID Connect (OIDC) authentication:

1name: Continuous Deployment
2 
3on:
4 push:
5 branches: [main]
6 
7permissions:
8 id-token: write # Required for secure OIDC cloud authentication
9 contents: read
10 
11jobs:
12 deploy:
13 name: Deploy to Production CDN
14 runs-on: ubuntu-latest
15 
16 steps:
17 - name: Checkout Code
18 uses: actions/checkout@v4
19 
20 - name: Setup Node.js 20
21 uses: actions/setup-node@v4
22 with:
23 node-version: 20
24 cache: "npm"
25 
26 - name: Install Dependencies
27 run: npm ci
28 
29 - name: Build Application
30 run: npm run build
31 env:
32 VITE_API_URL: ${{ secrets.PROD_API_URL }}
33 
34 # Deploy static assets to AWS S3
35 - name: Configure AWS Credentials via OIDC
36 uses: aws-actions/configure-aws-credentials@v3
37 with:
38 role-to-assume: arn:aws:iam::123456789012:role/GitHubDeployRole
39 aws-region: us-east-1
40 
41 - name: Sync Assets to S3
42 run: |
43 aws s3 sync dist/ s3://enterprise-frontend-bucket/ --delete --cache-control "public, max-age=31536000, immutable" --exclude "index.html"
44 aws s3 cp dist/index.html s3://enterprise-frontend-bucket/index.html --cache-control "no-cache, no-store, must-revalidate"
45 
46 - name: Invalidate CloudFront CDN Cache
47 run: |
48 aws cloudfront create-invalidation --distribution-id ${{ secrets.CLOUDFRONT_DIST_ID }} --paths "/*"

4. Branch Protection Rules

In GitHub repository settings, configure Branch Protection Rules on main:

  • Require status checks to pass before merging: check validate job.
  • Require signed commits.
  • Require at least 1 peer code review approval.
  • Enforce linear git history.

This prevents any developer from accidentally pushing broken code directly into production.


Interactive Quiz• Knowledge Check

Practice Quiz

Question 1
What is the primary purpose of Continuous Integration (CI) in a React project?
Question 2
Why is actions/setup-node@v4 configured with cache: "npm"?
Question 3
Why does the S3 sync command exclude index.html when setting max-age=31536000, immutable?
Question 4
What is the advantage of using GitHub OpenID Connect (OIDC) over long-lived AWS IAM Secret Keys?
Question 5
What does a CloudFront cache invalidation command (aws cloudfront create-invalidation) achieve?
Next Lesson

Edge CDN Deployment with Cloudflare, Vercel, and Netlify

Continue learning with hands-on practice, examples, and exercises in the upcoming topic.

Related Lessons

Previous LessonNext Lesson
Dockerizing React Applications with Multi-Stage BuildsEdge CDN Deployment with Cloudflare, Vercel, and Netlify

Practice Quiz

Test your understanding of this lesson with 5 questions. Each question has one correct answer.

Mentor-Led Practical Training

Master React.js for Advanced with Hands-On Projects

Practice in live mentor-led sessions with real projects, mock tests, and verifiable certification at MSK Institute.

View Full CourseBook Free Demo
PreviousNext
PreviousPrevNext