Intro

<aside> 💡 CodePipeline and CodeBuild can be combined to build a single page application from MD files and copy the static files to an S3 bucket. This is because CodeBuild can run any commands, so you can use it to run commands including build a static website and copy your static web files to an S3 bucket; and CodePipeline will help make it into a pipeline.

</aside>

Build flow

Based on the environment (language), CodeBuild pulls an AWS pre-packaged Docker image or a custom image provided by us to build the source code into an artifact based on the instructions provided in buildspec.yaml. CodeBuild can cache some files (eg. dependencies) in an S3 bucket to share between builds in order to speed up future builds. The artifact created by the build stage is extracted out of the container and stored in the S3 bucket.

Untitled

buildspec.yaml