Ci/change pr check links target branch #11
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Remove preview for PR | |
on: | |
pull_request: | |
types: | |
- closed | |
jobs: | |
remove-preview: | |
name: Remove preview for PR | |
runs-on: ubuntu-latest | |
steps: | |
# Remove the PR-specific folder from S3 | |
- name: Remove PR-specific subdirectory from S3 | |
run: | | |
echo "Cleaning up preview folder for PR #${{ github.event.pull_request.number }}" | |
aws s3 rm "s3://${{ secrets.PREVIEW_AWS_BUCKET_NAME }}/pr${{ github.event.pull_request.number }}" --recursive | |
env: | |
AWS_REGION: ${{ secrets.AWS_REGION }} | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
- name: Invalidate CloudFront cache for PR | |
uses: chetan/invalidate-cloudfront-action@v2 | |
env: | |
PATHS: "/pr-${{ github.event.pull_request.number }}/*" | |
DISTRIBUTION: ${{ secrets.PREVIEW_CLOUDFRONT_DISTRIBUTION }} | |
AWS_REGION: ${{ secrets.AWS_REGION }} | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |