Skip to content

Merge pull request #9 from bzr-sys/github-action-deploy-s3 #2

Merge pull request #9 from bzr-sys/github-action-deploy-s3

Merge pull request #9 from bzr-sys/github-action-deploy-s3 #2

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: '{.*/**,**}'