diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6e440c2..f66479d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -9,7 +9,9 @@ jobs: if: github.event.pull_request.merged == true runs-on: ubuntu-latest steps: - - name: executing remote ssh commands using ssh key + + # npm 의존성 설치 + - name: npm install uses: appleboy/ssh-action@master with: host: ${{ secrets.HOST }} @@ -17,15 +19,19 @@ jobs: key: ${{ secrets.SSH_KEY }} #passphrase: ${{ secrets.PASSPHRASE }} port: 22 - - # npm 의존성 설치 - - name: npm install run: | cd ${{ secrets.PWD }} git pull origin main # Frontend Merge 시 React 빌드 - name: React build + uses: appleboy/ssh-action@master + with: + host: ${{ secrets.HOST }} + username: ${{ secrets.USERNAME }} + key: ${{ secrets.SSH_KEY }} + #passphrase: ${{ secrets.PASSPHRASE }} + port: 22 if: github.head_ref == 'Frontend' run: | cd ${{ secrets.PWD }}/Backend/Frontend/creative @@ -35,6 +41,13 @@ jobs: # Merge 하는 경우 서버 재시작 - name: server restart + uses: appleboy/ssh-action@master + with: + host: ${{ secrets.HOST }} + username: ${{ secrets.USERNAME }} + key: ${{ secrets.SSH_KEY }} + #passphrase: ${{ secrets.PASSPHRASE }} + port: 22 run: | cd ${{ secrets.PWD }}/BackendJS/BackendTS npm install