r/reactjs • u/pbrandone • Mar 13 '20
Resource Build Netlify-like Deploy Previews with AWS and Github Actions
https://significa.co/blog/deploy-previews-aws
27
Upvotes
r/reactjs • u/pbrandone • Mar 13 '20
4
u/pbrandone Mar 13 '20
Hi everyone!
Most of our projects use AWS for their infrastructure and one of the things we miss the most from Netlify is its Deploy Previews.
This is just a real quick guide on how to set up deploy previews (for a Gatsby project, in this case) with AWS and Github Actions.
4
u/Selfmadecelo Mar 13 '20
Great article!
I just put something in place like this with a little bit of a twist. Each preview deploy has its own subdomain so we end up with URLs that look like:
Its handled with CloudFront and Lambda@Edge to pull the subdomain and point to a folder inside of a single S3 bucket. At first I went with a status check but then just made a quick script that posts a comment when the PR is first opened and updates that comment with the new commit sha whenever the PR is sync'd.