diff --git a/.github/workflows/pushServerCICD.yml b/.github/workflows/pushServerCICD.yml index 1aacb71..48aa0bb 100644 --- a/.github/workflows/pushServerCICD.yml +++ b/.github/workflows/pushServerCICD.yml @@ -63,19 +63,15 @@ jobs: echo SLACK_API_TOKEN=${{ secrets.SLACK_API_TOKEN }} >> .env - # CI 시, build하여 server.js 파일 생성 - - name: Run build - run: | - echo NODE_ENV="development" >> .env - npm run build --if-present - + # main 브랜치에 대한 PR만 빌드하여 S3에 업로드 - name: Run build (main) if: ${{ github.base_ref == 'main' }} run: | echo NODE_ENV="production" >> .env - npm run build:production --if-present + npm run build:production --if-present - name: Sharing files between jobs. + if: ${{ github.base_ref == 'main' }} uses: actions/upload-artifact@v1 with: name: dist @@ -83,6 +79,7 @@ jobs: deploy: needs: build + if: ${{ github.base_ref == 'main' }} runs-on: ubuntu-latest steps: # build job에서 빌드한 파일(./dist/pushScheduler.js) 가져오기