In previous post, I’ve wrote about on how to push a Jekyll site to Heroku. In this post it will be about how I host this blog in AWS S3 bucket.
Turns out it is much simpler to do it in S3.
Create a S3 bucket
Create a S3 bucket and enable Web Hosting in the properties.
Configure Github Action
You will need to configure following secrets in your Github setting.
AWS_S3_BUCKETwith your bucket name.
AWS_ACCESS_KEY_IDwith your AWS access key id.
AWS_SECRET_ACCESS_KEYwith your AWS secret access id.
With a push to
master branch, it will trigger a build which will
- Checkout code from
- Generate Jekyll static files.
- Push generated files inside
_sitefolder to your S3 bucket.
This seems like a cheaper option for hosting a static site and have SSL configured in CloudFront compared to paying for a dyno in Heroku to host a site with SSL. For Heroku, I will need to pay atleast $7/month for a dyno and for CloudFront it will based on usage. Since my blog does not have much visitors, my AWS bill is very small which is around $1/month. This includes S3, Route 53 and CloudFront services.