PROJECT OVERVIEW
This project demonstrates how to host a static website on Amazon S3, deliver it globally with CloudFront CDN, and automate deployments using GitHub Actions.
๐ Features
- โ Static website hosting on Amazon S3
- โ CloudFront CDN for global fast delivery + HTTPS
- โ CI/CD pipeline with GitHub Actions (auto-deploy on push)
- โ Cache invalidation so updates are live instantly
- โ Secure Origin Access Control (OAC) โ S3 is private, only CloudFront can access
๐๏ธ Architecture Workflow
๐น Request Flow
User โ CloudFront (Edge Cache) โ [If cache miss] โ S3 Bucket โ CloudFront โ User
๐น Deployment Flow
Developer โ GitHub Repo โ GitHub Actions โ S3 Bucket โ CloudFront โ End User
โ๏ธ Setup Instructions
1๏ธโฃ Create S3 Bucket
- Go to AWS S3 Console
- Create a bucket (region example:
ap-south-1) - Keep Block Public Access = ON
- Upload your static website files (
index.html, CSS, JS, images, etc.)
2๏ธโฃ Create CloudFront Distribution
- Open CloudFront Console โ Create Distribution
- Origin = your S3 bucket
- Use Origin Access Control (OAC) (so only CloudFront can read from S3)
- Copy the CloudFront domain (e.g.,
d1234abcd.cloudfront.net)
3๏ธโฃ Configure GitHub Actions
๐ Secrets Setup in GitHub
Go to GitHub Repo โ Settings โ Secrets and variables โ Actions โ New repository secret
Add:
AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY
๐ Access Your Website
Default โ (your CloudFront domain)
Optional โ Add Route 53 + ACM SSL to use a custom domain
๐ Future Improvements
Add CloudWatch monitoring & logging
Add Route 53 + SSL certificate for a custom domain
Extend pipeline with tests before deployment
๐ Learning Outcome
By completing this project, I learned:
How to use AWS S3 for static hosting
How CloudFront works as a CDN with OAC
How to build a CI/CD pipeline with GitHub Actions
How to automate deployments and cache invalidations
๐ Keywords: AWS, S3, CloudFront, GitHub Actions, CI/CD, DevOps, Cloud
๐Github
โก Now, every time I push code to GitHub, my website auto-deploys to AWS with CloudFront CDN ๐







Top comments (0)