π¦οΈ Chore: S3-CloudFront CICD Settings μμ #27
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: Deploy to S3 and CloudFront | |
on: | |
push: | |
branches: [dev] # dev λΈλμΉμ νΈμλ λ μν¬νλ‘μ° μ€ν | |
env: | |
CI: false # CI νκ²½ λ³μ μ€μ | |
jobs: | |
build: | |
runs-on: ubuntu-latest # μ΅μ μ°λΆν¬ νκ²½μμ μ€ν | |
steps: | |
- name: Checkout source code | |
uses: actions/checkout@v2 # μν¬νλ‘μ°μμ μ‘μΈμ€ν μ μλλ‘ μ μ₯μλ₯Ό 체ν¬μμ | |
- name: Install dependencies | |
run: yarn install # νλ‘μ νΈμ μμ‘΄μ± μ€μΉ | |
- name: Build | |
run: yarn build # νλ‘μ νΈ λΉλ | |
- name: S3 Deploy | |
run: aws s3 sync ./dist s3://bobpience-s3-bucket/ --acl bucket-owner-full-control # νμ¬ λΉλλ ν΄λμ μ κ·Ό ν S3 λ²ν·μ λΉλ νμΌ μ λ‘λ | |
env: | |
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 리μ | |
- name: Invalidate CloudFront Cache | |
uses: chetan/invalidate-cloudfront-action@master # CloudFront μΊμ 무ν¨ν - CloudFrontλ λ°°ν¬ μ μ μ©κΉμ§ 24μκ°μ΄ μμλλ€. μ λ°μ΄νΈ λ΄μ©μ λ°μνκΈ°μν΄μλ λ°λμ 무ν¨ν μ²λ¦¬κ° νμνλ€ | |
env: | |
AWS_DISTRIBUTION: ${{ secrets.AWS_DISTRIBUTION_ID }} # CloudFront λ°°ν¬ ID | |
PATHS: '/*' # 무ν¨νν κ²½λ‘ | |
continue-on-error: true # μ€λ₯ λ°μ μμλ κ³μ μ§ν |