Step 1: Create Your Repository
Start by creating a new GitHub repository. Add your static website files
(index.html
, style.css
, images, etc.) and push them to GitHub.
Step 2: Set Up an S3 Bucket
On AWS, create an S3 bucket to store your static site. Enable static website hosting and note the bucket name. (Tip: Keep the bucket private and use CloudFront for secure delivery.)
Step 3: Configure GitHub Actions
Inside your repo, create a folder .github/workflows
and add a
deploy.yml
file.
Define a workflow that:
- Triggers on every push to
main
- Installs AWS CLI
- Syncs your files to the S3 bucket
Step 4: Add AWS Credentials
In GitHub, go to your repo settings → Secrets and Variables.
Add your AWS_ACCESS_KEY_ID
and AWS_SECRET_ACCESS_KEY
.
This allows GitHub Actions to deploy files securely to AWS.
Step 5: Set Up CloudFront + Route 53
Use AWS CloudFront to distribute your site globally with caching and HTTPS. Connect your custom domain in Route 53 and link it to the CloudFront distribution.
Step 6: Commit & Deploy
Push your code to GitHub. GitHub Actions will automatically build and deploy your static site to S3 + CloudFront. Open your domain, and 🎉 your website is live!