From 0c35d3eeef99c3b5521d95b51c788cce4bec3628 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Gr=C3=A9vin?= Date: Mon, 11 Mar 2024 10:56:34 +0100 Subject: [PATCH] fix(ci) Fix clean cache for staging --- .github/workflows/deploy.yml | 12 +++--------- .github/workflows/pr-closed.yml | 2 +- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 09a3354f3..1927c802f 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -127,17 +127,11 @@ jobs: ref: ${{ github.head_ref }} env: ${{ env.ENV }} - - name: Deploy to S3 for dev - if: github.event_name == 'pull_request' - run: aws s3 sync "dist/public/" "s3://${{ vars.AWS_BUCKET_NAME }}/${{ github.head_ref }}/" --delete - - - name: Deploy to S3 for production - if: github.ref == 'refs/heads/master' && github.event_name == 'push' - run: aws s3 sync "dist/public/" "s3://${{ vars.AWS_BUCKET_NAME }}/" --delete + - name: Deploy to S3 + run: aws s3 sync "dist/public/" "s3://${{ vars.AWS_BUCKET_NAME }}${{ env.BASE_URL }}" --delete - name: Clear caches - if: github.ref == 'refs/heads/master' && github.event_name == 'push' - run: aws cloudfront create-invalidation --distribution-id "${{ secrets.AWS_CLOUDFRONT_DISTRIBUTION_ID }}" --paths "/*" + run: aws cloudfront create-invalidation --distribution-id "${{ secrets.AWS_CLOUDFRONT_DISTRIBUTION_ID }}" --paths "${{ env.BASE_URL }}*" - name: Indexing on Algolia run: yarn indexation:algolia diff --git a/.github/workflows/pr-closed.yml b/.github/workflows/pr-closed.yml index 4d6915d28..669c28186 100644 --- a/.github/workflows/pr-closed.yml +++ b/.github/workflows/pr-closed.yml @@ -27,5 +27,5 @@ jobs: with: step: deactivate-env token: ${{ secrets.GITHUB_TOKEN }} - env: "dev-${{ github.head_ref }}" + env: ${{ github.head_ref }} desc: Environment was pruned