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)