From 00cb35eb020afab2394606de389914f98524f9c7 Mon Sep 17 00:00:00 2001 From: redundant4u Date: Tue, 25 Jul 2023 10:04:40 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20cloudfront=20=EB=8F=84=EC=9E=85=EC=9C=BC?= =?UTF-8?q?=EB=A1=9C=20cicd=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/deploy_dev.yml | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/.github/workflows/deploy_dev.yml b/.github/workflows/deploy_dev.yml index 783d5e24e..685a77731 100644 --- a/.github/workflows/deploy_dev.yml +++ b/.github/workflows/deploy_dev.yml @@ -41,7 +41,7 @@ jobs: run: CI= npm run build - name: Compress - run: tar -zcvf ${GITHUB_SHA::8}.tar.gz build + run: tar -zcf ${GITHUB_SHA::8}.tar.gz build - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -56,17 +56,16 @@ jobs: ${GITHUB_SHA::8}.tar.gz \ ${{ secrets.S3_DEV_FRONT_LOCATION }}/${GITHUB_SHA::8}.tar.gz - - name: Deploy - uses: appleboy/ssh-action@master - with: - host: ${{ secrets.SSH_HOST_DEV }} - username: ${{ secrets.SSH_USERNAME_DEV }} - port: ${{ secrets.SSH_PORT_DEV }} - key: ${{ secrets.SSH_KEY_DEV }} - envs: GITHUB_SHA - script: | - cd ~/keeper/renewal/deploy - ./deploy_client.sh ${GITHUB_SHA::8} dev + - name: Sync to S3 + run: | + aws s3 sync build ${{ secrets.S3_DEV_FRONT_DEPLOYMENT }} \ + --delete + + - name: Invalidate CloudFront Cache + run: | + aws cloudfront create-invalidation \ + --distribution-id ${{ secrets.CLOUDFRONT_DEV_DISTRIBUTION_ID }} \ + --paths "/*" - name: Notify Slack if: always()