Skip to content

Commit

Permalink
Merge pull request #9 from bzr-sys/github-action-deploy-s3
Browse files Browse the repository at this point in the history
Add GitHub action to deploy to S3 and invalidate Cloudfront cache
  • Loading branch information
paddyohanlon authored Oct 15, 2024
2 parents 89e928d + 21df690 commit d0d6ce9
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/aws-s3-cloudfront-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Deploy to S3 and invalidate Cloudfront cache
on: [push]
jobs:
run:
runs-on: ubuntu-latest
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
steps:
- uses: actions/checkout@v3

- name: Install dependencies
run: npm ci

- name: Build
run: npm run build

- name: Deploy
uses: reggionick/s3-deploy@v4
with:
folder: dist
bucket: ${{ secrets.S3_BUCKET }}
bucket-region: ${{ secrets.S3_BUCKET_REGION }}
dist-id: ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }}
invalidation: /
delete-removed: true
no-cache: true
private: true
files-to-include: '{.*/**,**}'

0 comments on commit d0d6ce9

Please sign in to comment.