From fbddf1aeecbf05e4a5dc36a3b02b80fdea20a51f Mon Sep 17 00:00:00 2001 From: jayvaznewm <124834404+jayvaznewm@users.noreply.github.com> Date: Fri, 11 Oct 2024 11:54:34 -0700 Subject: [PATCH] Invalidate cloudfront cache after updating S3 to avoid stale content from being served (#746) --- .../aws-hosting-deploy-published-release-newm-studio.yml | 3 +++ .github/workflows/aws-hosting-merge-deploy-newm-studio.yml | 3 +++ 2 files changed, 6 insertions(+) diff --git a/.github/workflows/aws-hosting-deploy-published-release-newm-studio.yml b/.github/workflows/aws-hosting-deploy-published-release-newm-studio.yml index 3d7a916e..a6b30516 100644 --- a/.github/workflows/aws-hosting-deploy-published-release-newm-studio.yml +++ b/.github/workflows/aws-hosting-deploy-published-release-newm-studio.yml @@ -41,6 +41,9 @@ jobs: - name: Deploy studio run: aws --region ${{ secrets.AWS_REGION }} s3 sync ./dist/apps/studio s3://${{ secrets.AWS_STUDIO_BUCKET_STUDIO }} --no-progress --delete + - name: Invalidate Cloudfront Cache + run: aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_STUDIO_DISTRIBUTION_STUDIO }} --paths '/*' + - name: Send update to slack id: slack uses: slackapi/slack-github-action@v1.26.0 diff --git a/.github/workflows/aws-hosting-merge-deploy-newm-studio.yml b/.github/workflows/aws-hosting-merge-deploy-newm-studio.yml index 2421d045..36b7f3cd 100644 --- a/.github/workflows/aws-hosting-merge-deploy-newm-studio.yml +++ b/.github/workflows/aws-hosting-merge-deploy-newm-studio.yml @@ -37,6 +37,9 @@ jobs: - name: Deploy to S3 run: aws --region ${{ secrets.AWS_REGION }} s3 sync ./dist/apps/studio s3://${{ secrets.AWS_STUDIO_BUCKET_GARAGE }} --no-progress --delete + - name: Invalidate Cloudfront Cache + run: aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_STUDIO_DISTRIBUTION_GARAGE }} --paths '/*' + - name: Send update to slack id: slack uses: slackapi/slack-github-action@v1.17.0