I'd like to automate deploying our site to AWS S3. I've written a node script to automate building and uploading the site, but I'd like to have the script automatically run whenever the master branch of our repo is updated on github.
I looked into AWS CodeDeploy, but it looks like that's for specifically deploying to EC2. I've also looked at AWS Lambda, but there doesn't seem to be a clear way to pull a copy of the repo using git so I can run the script.
Any services (preferably tied to AWS) that I can use?
To enable static website hosting Sign in to the AWS Management Console and open the Amazon S3 console at https://console.aws.amazon.com/s3/ . In the Buckets list, choose the name of the bucket that you want to enable static website hosting for. Choose Properties. Under Static website hosting, choose Edit.
I had the same goal some time ago and have now released a little tool, which solves the problem at least for me. It uses AWS Lambda and deploys a specific branch of the repository to S3 after push. You can take full advantage of the GitHub deploy key, which has fewer permissions as personal access tokens and can be configured per repository.
Please take a look at github-bucket, it might help you too.

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With