๐ฆChore: ๋ฐฐํฌ๋ฅผ ์ํ main ๋ธ๋์น๋ก PR #2
This file contains hidden or 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: PR Preview Cleanup (S3 Cleanup + CloudFront ๋ฌดํจํ) | |
| on: | |
| pull_request: | |
| types: [closed] | |
| jobs: | |
| cleanup-preview: | |
| runs-on: ubuntu-latest | |
| env: | |
| BUCKET_NAME: starsync | |
| steps: | |
| - name: AWS ์ธ์ฆ ์ ๋ณด ์ค์ | |
| uses: aws-actions/configure-aws-credentials@v4 | |
| with: | |
| aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
| aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
| aws-region: ${{ secrets.AWS_REGION }} | |
| - name: Preview S3 ํ์ผ ์ญ์ (PR ๋ซํ ๋) | |
| run: | | |
| PREVIEW_PATH="preview/pr-${{ github.event.pull_request.number }}" | |
| echo "๐งน S3 ๊ฒฝ๋ก ์ญ์ ์ค: s3://$BUCKET_NAME/$PREVIEW_PATH/" | |
| aws s3 rm s3://$BUCKET_NAME/$PREVIEW_PATH/ --recursive | |
| - name: CloudFront ์บ์ ๋ฌดํจํ (Preview PR ๊ฒฝ๋ก) | |
| run: | | |
| INVALIDATION_PATH="/preview/pr-${{ github.event.pull_request.number }}/*" | |
| echo "๐ ์บ์ ๋ฌดํจํ ๋์: $INVALIDATION_PATH" | |
| aws cloudfront create-invalidation \ | |
| --distribution-id ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }} \ | |
| --paths "$INVALIDATION_PATH" |