Skip to content

Commit

Permalink
fix(ci) Fix clean cache for staging (#1077)
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-grevin committed Mar 11, 2024
1 parent 94ea27f commit c0942cc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
12 changes: 3 additions & 9 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-closed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit c0942cc

Please sign in to comment.