-
-
Save unloadedroe/8faff7da7f1dc471042ffa24e404434f to your computer and use it in GitHub Desktop.
AWS CodePipeline CodeBuild middleman build deploy to S3 and invalidate cloudfront cache
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| version: 0.1 | |
| phases: | |
| install: | |
| commands: | |
| - apt-get update | |
| - apt-get install nodejs -y | |
| - gem install bundler | |
| - gem install middleman | |
| pre_build: | |
| commands: | |
| - bundle install | |
| build: | |
| commands: | |
| - middleman build | |
| post_build: | |
| commands: | |
| - aws s3 sync build/ "s3://${BUCKET_NAME}" --acl=public-read --delete | |
| - aws cloudfront create-invalidation --distribution-id "${DISTRIBUTION_ID}" --paths /index.html /* /fonts/* /images/* /javascripts/* /stylesheets/* /favicon.ico |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| - Give CodeBuild project role access to S3 and CloudFront | |
| - Set specified environment variables |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment