A production-grade GitHub Actions pipeline for automating build, test, lint, and cloud deployment of React applications.
This repository provides a fully automated CI/CD pipeline built with GitHub Actions for React applications using Vite. It covers the complete delivery lifecycle from code commit to cloud deployment with zero manual intervention.
Designed for teams and engineers who want a reliable, repeatable, and professional deployment workflow without the overhead of complex DevOps tooling.
Push / Pull Request
│
▼
┌───────────────────┐
│ Lint & Validate │ ← ESLint static analysis
└────────┬──────────┘
│
▼
┌───────────────────┐
│ Build & Test │ ← Vite production build
└────────┬──────────┘
│
▼
┌───────────────────┐
│ Deploy to AWS │ ← S3 sync + CloudFront invalidation
└───────────────────┘
| Stage | Action | Trigger |
|---|---|---|
| Lint | Runs ESLint across all source files | Every push and PR |
| Build | Compiles and bundles via Vite | Every push and PR |
| Deploy | Syncs build artifacts to AWS S3 | Push to main only |
| Invalidate | Clears CloudFront CDN cache | Post-deploy on main |
| Layer | Technology |
|---|---|
| Frontend Framework | React 18 |
| Build Tool | Vite |
| CI/CD Automation | GitHub Actions |
| Cloud Storage | AWS S3 |
| CDN | AWS CloudFront |
| Code Quality | ESLint |
git clone https://github.com/ahmedrazakhann/cicd-pipeline-react-aws.git
cd cicd-pipeline-react-awsnpm installnpm run devnpm run lintnpm run buildConfigure the following secrets in your repository under Settings → Secrets and Variables → Actions:
| Secret | Description |
|---|---|
AWS_ACCESS_KEY_ID |
AWS IAM access key |
AWS_SECRET_ACCESS_KEY |
AWS IAM secret key |
AWS_REGION |
Target AWS region (e.g. us-east-1) |
S3_BUCKET_NAME |
Target S3 bucket for deployment |
CLOUDFRONT_DISTRIBUTION_ID |
CloudFront distribution ID for cache invalidation |
.github/
└── workflows/
└── deploy.yml ← Main CI/CD pipeline
Most deployment pipelines are either too complex for small teams or too simple for production environments. This pipeline sits precisely in the middle — straightforward enough to understand in one read, robust enough to deploy real applications with confidence.
Ahmed Raza Khan Full-Stack Engineer · AWS Certified ML Associate
theahmedraza.com · LinkedIn · ahmed@theahmedraza.com