Skip to content

Instantly share code, notes, and snippets.

@nyambeni
Forked from kylegalbraith/buildspec.yml
Created December 3, 2021 14:55
Show Gist options
  • Save nyambeni/ccecaa6946f81e7b879dc0b8fe6891a3 to your computer and use it in GitHub Desktop.
Save nyambeni/ccecaa6946f81e7b879dc0b8fe6891a3 to your computer and use it in GitHub Desktop.
buildspec.yml with CloudFront invalidation
version: 0.2
phases:
install:
commands:
- echo "install step"
pre_build:
commands:
- echo "pre_build step"
build:
commands:
- aws s3 sync --delete . "s3://<your-static-website-bucket>"
post_build:
commands:
- aws cloudfront create-invalidation --distribution-id <your-distribution-id> --paths '/*'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment