From cdf7f8b388d0e8fb20dee9cb5e0449e6c4d1d86c Mon Sep 17 00:00:00 2001 From: kimkyuhong <94050324+rtttr1@users.noreply.github.com> Date: Sat, 29 Mar 2025 17:32:51 +0900 Subject: [PATCH 1/2] =?UTF-8?q?docs:=20cd=20=ED=8C=8C=EC=9D=BC=20=EC=88=98?= =?UTF-8?q?=EC=A0=95=20(#505)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/client-cd.yml | 51 +++++++++------------------------ 1 file changed, 14 insertions(+), 37 deletions(-) diff --git a/.github/workflows/client-cd.yml b/.github/workflows/client-cd.yml index b1412cba..2fa56ca5 100644 --- a/.github/workflows/client-cd.yml +++ b/.github/workflows/client-cd.yml @@ -4,47 +4,24 @@ on: push: branches: - main + pull_request: + branches: + - main jobs: - build: - name: Build and Deploy + deploy: + name: Deploy runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v3 - - - name: Setup Node.js - uses: actions/setup-node@v4 + + - name: executing remote ssh commands using key + uses: appleboy/ssh-action@master with: - node-version: '21' - - - name: Setup pnpm - uses: pnpm/action-setup@v4 - with: - version: 9.1.3 - - - name: Install dependencies - run: pnpm install --frozen-lockfile - - - name: Build project - run: pnpm build - - - name: .env setting - run: | - echo "VITE_BASE_URL=${{ secrets.VITE_BASE_URL }}" >> .env - - - name: Build - run: pnpm build - - - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@v1 - with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: us-east-1 - - - name: Upload build to AWS S3 - run: aws s3 sync dist s3://${{ secrets.AWS_S3_BUCKET_NAME }} --delete --cache-control "max-age=31536000" - - - name: Invalidate AWS CloudFront Distribution - run: aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_CLOUDFRONT_ID }} --paths "/*" + host: ${{ secrets.HOST }} + username: ${{ secrets.USERNAME }} + key: ${{ secrets.KEY }} + port: ${{ secrets.PORT }} + script: | + ./deploy.sh From 8f2ca66bf66487a0fc17d1f3ffe6bb858554e75d Mon Sep 17 00:00:00 2001 From: kimkyuhong <94050324+rtttr1@users.noreply.github.com> Date: Sat, 29 Mar 2025 17:52:34 +0900 Subject: [PATCH 2/2] Update client-cd.yml --- .github/workflows/client-cd.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/client-cd.yml b/.github/workflows/client-cd.yml index 2fa56ca5..a7bd67d3 100644 --- a/.github/workflows/client-cd.yml +++ b/.github/workflows/client-cd.yml @@ -24,4 +24,5 @@ jobs: key: ${{ secrets.KEY }} port: ${{ secrets.PORT }} script: | + chmod +x ./deploy.sh ./deploy.sh