From 288ee9a080cbc527d88775f6073cc12f2633b822 Mon Sep 17 00:00:00 2001 From: YOON CHAN HO <108210104+yooooonshine@users.noreply.github.com> Date: Fri, 17 Jan 2025 15:28:57 +0900 Subject: [PATCH] Update gradle.yml --- .github/workflows/gradle.yml | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 228e7530..5e2431b6 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -1,4 +1,3 @@ - name: Java CI with Gradle on: @@ -39,29 +38,26 @@ jobs: run: cd backend/ && ./gradlew build - name: Upload build artifact - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: backend path: ./backend/build/libs/backend-0.0.1-SNAPSHOT.jar - # 배포 ** deploy: needs: build runs-on: ubuntu-latest steps: - name: Download build artifact - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v3 with: name: backend path: ./backend/build/libs/ - name: Deploy to EC2 run: | - echo "${{ secrets.EC2_SSH_KEY }}" > middle-point-search.pem - chmod 600 middle-point-search.pem - scp -i middle-point-search.pem -o StrictHostKeyChecking=no ./backend/build/libs/backend-0.0.1-SNAPSHOT.jar ${{ secrets.EC2_USERNAME }}@${{ secrets.EC2_HOST }}:/home/${{ secrets.EC2_USERNAME }}/backend-0.0.1-SNAPSHOT.jar - ssh -i middle-point-search.pem -o StrictHostKeyChecking=no ${{ secrets.EC2_USERNAME }}@${{ secrets.EC2_HOST }} "pgrep java | xargs kill -9; nohup java -jar /home/${{ secrets.EC2_USERNAME }}/backend-0.0.1-SNAPSHOT.jar &" - rm -f middle_point.pem - - + echo "${{ secrets.EC2_SSH_KEY }}" > sync_spot_dev.pem + chmod 600 sync_spot_dev.pem + scp -i sync_spot_dev.pem -o StrictHostKeyChecking=no ./backend/build/libs/backend-0.0.1-SNAPSHOT.jar ${{ secrets.EC2_USERNAME }}@${{ secrets.EC2_HOST }}:/home/${{ secrets.EC2_USERNAME }}/backend-0.0.1-SNAPSHOT.jar + ssh -i sync_spot_dev.pem -o StrictHostKeyChecking=no ${{ secrets.EC2_USERNAME }}@${{ secrets.EC2_HOST }} "pgrep java | xargs kill -9; nohup java -jar /home/${{ secrets.EC2_USERNAME }}/backend-0.0.1-SNAPSHOT.jar &" + rm -f sync_spot_dev.pem