Skip to content

feat: invalidate Cloudfront on deployment #2

feat: invalidate Cloudfront on deployment

feat: invalidate Cloudfront on deployment #2

Workflow file for this run

name: Deploy WASM bundle
on:
push:
branches: ["main", "develop"]
pull_request:
branches: ["main"]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: "18"
- name: Install dependencies and build
run: |
cd wasm
npm ci
npm run build
- name: Setup AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-west-1
- name: Upload to S3
run: |
aws s3 sync wasm/dist s3://zakfarmer-php-rs
- name: Invalidate CloudFront Cache
run: |
aws cloudfront create-invalidation --distribution-id ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }} --paths "/*"