Continuous deployment of React websites to Amazon S3
This sample includes a continuous deployment pipiline for websites built with React. We use AWS CodePipeline, CodeBuild, and SAM to deploy the application. To deploy the application to S3 using SAM we use a custom CloudFormation resource.
buildspec.yml: YAML configuration for CodeBuild, this file should be in the root of your code repository
configure.js: Script executed in the build step to generate a config.json file for the application, this is used to include values exported by other CloudFormation stacks (separate services of the same application).
index.js: Custom CloudFormation resource that publishes the website to an S3 bucket. As you can see from the buildspec and SAM template, this function is located in a
s3-deployment-custom-resourcesub-folder of the repo
app-sam.yaml: Serverless Application model YAML file. This configures the S3 bucket and the cu