AWS S3 + CloudFront Deployment Guide
This document explains how to deploy the UBA-Pilot frontend to AWS S3 and serve it globally via CloudFront.
There are four deployment options:
Manual build & upload to S3
Manual build & push via AWS CLI
GitHub Actions pipeline (auto-deployment)
Hybrid option (manual trigger but automated pipeline)
β οΈ Before deploying, you need to complete the AWS setup below.
1. AWS Setup (Common for All Options)
1.1 Create an S3 Bucket
π Create S3 Bucket
Enter a unique bucket name and choose the region.
Uncheck βBlock all public accessβ if you plan to serve static files publicly.
Click Create bucket.
1.2 Enable Static Website Hosting
π Enable Static Website Hosting
Set:
Index document:
index.htmlError document:
index.html(important for SPA routing)
1.3 Set Up CloudFront Distribution
π Create CloudFront Distribution
Select your S3 bucket as the origin.
Set Viewer Protocol Policy β Redirect HTTP to HTTPS.
Set Default Root Object β
index.html.Enable Origin Access Control (OAC) to restrict direct S3 access (recommended).
1.4 (Optional) Configure Custom Domain & SSL
Go to Route 53 Hosted Zones β create an ALIAS or CNAME record pointing to CloudFront.
Attach an ACM SSL certificate (must be in
us-east-1for CloudFront).Update CloudFront β include the Alternate Domain Name (CNAME).
1.5 Invalidate CloudFront Cache
Whenever you deploy new frontend assets, invalidate the cache.
2. Manual Build & Upload to S3 (AWS Console)
Build frontend locally:
Output folder:
dist/orbuild/.Open your bucket β Upload all files from the
dist/folder. π Go to S3 BucketsInvalidate CloudFront cache (see step 1.5).
β Your frontend is updated.
3. Manual Build & Push Code to S3 (AWS CLI)
Build frontend locally:
Install AWS CLI (if not installed):
Configure AWS credentials:
Sync build to S3:
Invalidate CloudFront cache:
π AWS CLI Command Reference: create-invalidation
4. GitHub Actions: Automated Deployment
Tag-based deployment pipeline automatically builds and deploys the frontend to S3 & CloudFront.
Workflow: .github/workflows/deploy.yml (Your workflow as provided β unchanged)
How to deploy:
Commit changes.
Create a version tag:
GitHub Actions will:
Build the frontend
Push artifacts to S3
Update CloudFront
Notify on Slack
β Fully automated. π GitHub Actions Documentation
5. Hybrid: Manual Trigger of Pipeline (Optional)
Update workflow with:
Then:
Go to GitHub β Actions β Deploy to UBA-Pilot β Run workflow π Run Workflow
Select environment (
pilot/staging/prod).
The pipeline executes the same steps as automated tag deployment.
Last updated
