Skip to content

Commit 8e4e707

Browse files
committed
cloudfront invalidations on deploy
1 parent 66b3a8d commit 8e4e707

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,12 @@ jobs:
4141
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
4242
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
4343
SOURCE_DIR: 'Output/'
44+
# Invalidate CloudFront cache
45+
- name: Invalidate CloudFront cache
46+
uses: chetan/invalidate-cloudfront-action@v2
47+
env:
48+
DISTRIBUTION: ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }}
49+
PATHS: '/index.html /page/* /feed.rss'
50+
AWS_REGION: 'us-east-1'
51+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
52+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,6 @@ https://github.com/pvzig/bytesized.co/blob/master/.github/workflows/deploy.yml
2222

2323
Configure the following secrets in Github (/repo/settings/secrets)
2424
- `AWS_S3_BUCKET`
25+
- `CLOUDFRONT_DISTRIBUTION_ID`
2526
- `AWS_ACCESS_KEY_ID`
2627
- `AWS_SECRET_ACCESS_KEY`

0 commit comments

Comments
 (0)