Skip to content

Commit

Permalink
πŸ“¦οΈ Chore: S3-CloudFront CICD Settings μˆ˜μ •
Browse files Browse the repository at this point in the history
  • Loading branch information
jinyeongjang authored Oct 12, 2024
1 parent 1401389 commit f0cd906
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,7 @@ jobs:

steps:
- name: Checkout source code
uses: actions/checkout@v3 # μ›Œν¬ν”Œλ‘œμš°μ—μ„œ μ•‘μ„ΈμŠ€ν•  수 μžˆλ„λ‘ μ €μž₯μ†Œλ₯Ό 체크아웃

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '16'
uses: actions/checkout@v2 # μ›Œν¬ν”Œλ‘œμš°μ—μ„œ μ•‘μ„ΈμŠ€ν•  수 μžˆλ„λ‘ μ €μž₯μ†Œλ₯Ό 체크아웃

- name: Install dependencies
run: yarn install # ν”„λ‘œμ νŠΈμ˜ μ˜μ‘΄μ„± μ„€μΉ˜
Expand All @@ -29,14 +24,19 @@ jobs:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} # AWS μ•‘μ„ΈμŠ€ ν‚€ ID
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} # AWS μ‹œν¬λ¦Ώ μ•‘μ„ΈμŠ€ ν‚€
aws-region: ${{ secrets.AWS_REGION }} # AWS 리전
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}

- name: Delete existing contents from S3 bucket
run: aws s3 rm s3://bobpience-s3-bucket --recursive

- name: S3 Deploy
run: aws s3 sync ./dist s3://bobpience-s3-bucket/ --delete # ν˜„μž¬ λΉŒλ“œλœ 폴더에 μ ‘κ·Ό ν›„ S3 버킷에 λΉŒλ“œ 파일 μ—…λ‘œλ“œ, λΆˆν•„μš”ν•œ 파일 μ‚­μ œ
run: aws s3 sync ./dist s3://bobpience-s3-bucket/ --acl bucket-owner-full-control # ν˜„μž¬ λΉŒλ“œλœ 폴더에 μ ‘κ·Ό ν›„ S3 버킷에 λΉŒλ“œ 파일 μ—…λ‘œλ“œ

- name: Invalidate CloudFront Cache
run: |
aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_DISTRIBUTION_ID }} --paths "/*"
# CloudFront μΊμ‹œ λ¬΄νš¨ν™” - CloudFrontλŠ” 배포 μ‹œ μ μš©κΉŒμ§€ 24μ‹œκ°„μ΄ μ†Œμš”λœλ‹€. μ—…λ°μ΄νŠΈ λ‚΄μš©μ„ λ°˜μ˜ν•˜κΈ°μœ„ν•΄μ„œλŠ” λ°˜λ“œμ‹œ λ¬΄νš¨ν™” μ²˜λ¦¬κ°€ ν•„μš”ν•˜λ‹€
uses: chetan/invalidate-cloudfront-action@master # CloudFront μΊμ‹œ λ¬΄νš¨ν™” - CloudFrontλŠ” 배포 μ‹œ μ μš©κΉŒμ§€ 24μ‹œκ°„μ΄ μ†Œμš”λœλ‹€. μ—…λ°μ΄νŠΈ λ‚΄μš©μ„ λ°˜μ˜ν•˜κΈ°μœ„ν•΄μ„œλŠ” λ°˜λ“œμ‹œ λ¬΄νš¨ν™” μ²˜λ¦¬κ°€ ν•„μš”ν•˜λ‹€
env:
AWS_DISTRIBUTION: ${{ secrets.AWS_DISTRIBUTION_ID }} # CloudFront 배포 ID
PATHS: '/*' # λ¬΄νš¨ν™”ν•  경둜
continue-on-error: true # 였λ₯˜ λ°œμƒ μ‹œμ—λ„ 계속 진행

0 comments on commit f0cd906

Please sign in to comment.