From 70612555b62ccefc43f0a2451bc4b244d7afb63b Mon Sep 17 00:00:00 2001 From: Hyerin <125418818+ooherin@users.noreply.github.com> Date: Wed, 4 Dec 2024 11:10:37 +0900 Subject: [PATCH] =?UTF-8?q?[FE]=20github=20actions=20=EC=9C=BC=EB=A1=9C=20?= =?UTF-8?q?dev-fe=EC=9D=98=20cd=EB=A5=BC=20=EA=B5=AC=EC=B6=95=ED=95=9C?= =?UTF-8?q?=EB=8B=A4.=20=20(#1015)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/frontend-dev-cd.yml | 49 ++++++++++++++++++++++++++ backend/bang-ggood/.DS_Store | Bin 6148 -> 6148 bytes 2 files changed, 49 insertions(+) create mode 100644 .github/workflows/frontend-dev-cd.yml diff --git a/.github/workflows/frontend-dev-cd.yml b/.github/workflows/frontend-dev-cd.yml new file mode 100644 index 00000000..4afa837c --- /dev/null +++ b/.github/workflows/frontend-dev-cd.yml @@ -0,0 +1,49 @@ +name: Deploy Development to S3 and invalidate CloudFront Cache + +on: + push: + branches: + - dev-fe #dev-fe가 trigger 브랜치 + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [16.x] + + steps: + # 1. 소스코드 체크아웃 + - name: Checkout Source Code + uses: actions/checkout@v3 + + # 2. Node.js 설치 (필요시) + - name: Node.js + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + cache: "npm" + + # 3. 빌드 + - run: npm --force ci + + - name: Build Production + run: CI=false npm run build --if-present + + # 4. AWS Credentials 설정 + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v2 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: ap-northeast-2 # 서울 리전 + + # 5. S3에 파일 업로드 + - name: Deploy to S3 + run: | + aws s3 sync build/ s3://dev-fe.bang-ggood.com --delete + + # 6. CloudFront 캐시 무효화 + - name: Invalidate CloudFront Cache + run: aws cloudfront create-invalidation --distribution-id ${{ secrets.DEV_CLOUDFRONT_DISTRIBUTION_ID }} --paths "/*" diff --git a/backend/bang-ggood/.DS_Store b/backend/bang-ggood/.DS_Store index 2f804dcc34001fcd7e0f49d43c996feec94d0c53..179e772edf7716ebf77ea43b0a07ee7211646221 100644 GIT binary patch delta 48 zcmZoMXfc@JFUrBdz`)4BAi%(o!l1{H&QQdV$dIyGkYhPBBgbYlmW#|28?-jFbNuB8 E0OgGe?*IS* delta 85 zcmZoMXfc@JFU-lnz`)4BAi%(o;+d15oRpKFv{{g2C9^h2f|VhOp_Cz$AqOD|6a}hf Xa0Ft#|6sttu$hPDBJ*Z;j=%f>OaK