From 4d9612e05dcfd4bbbaafbb87c5c88d7d5e5f8928 Mon Sep 17 00:00:00 2001 From: Minsoek96 Date: Tue, 25 Feb 2025 22:01:34 +0900 Subject: [PATCH 1/2] fix : artifact upload/download to workflow for s3 deploy --- .github/workflows/main.yml | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6dba17d..dc95abf 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,10 +1,10 @@ name: Vite Build and Deploy -on: +on: push: branches: - main - pull_request: # PR 생성 시 실행되도록 추가 + pull_request: # PR 생성 시 실행되도록 추가 branches: - main @@ -33,11 +33,23 @@ jobs: - name: Debug Build Directory run: ls -l dist || echo "dist/ directory not found" + - name: Upload build artifact + uses: actions/upload-artifact@v3 + with: + name: dist + path: dist/ + deploy: if: github.event_name == 'push' # push 일 때만 배포 실행 runs-on: ubuntu-latest needs: build # build가 성공해야 deploy 실행 steps: + - name: Download build artifact + uses: actions/download-artifact@v3 + with: + name: dist + path: dist + - name: Deploy to S3 env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} @@ -45,4 +57,4 @@ jobs: run: | aws s3 sync \ dist/ s3://valia-react/ \ - --region ap-northeast-2 \ No newline at end of file + --region ap-northeast-2 From bbb903e3429d692d48040bc6961cb68522d804ca Mon Sep 17 00:00:00 2001 From: Minsoek96 Date: Tue, 25 Feb 2025 22:09:56 +0900 Subject: [PATCH 2/2] fix : update actions/upload-artifact to v4 --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index dc95abf..e4b4696 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -34,7 +34,7 @@ jobs: run: ls -l dist || echo "dist/ directory not found" - name: Upload build artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: dist path: dist/ @@ -45,7 +45,7 @@ jobs: needs: build # build가 성공해야 deploy 실행 steps: - name: Download build artifact - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: dist path: dist