diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6dba17d..e4b4696 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@v4 + 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@v4 + 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