diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index e72cde02..74e39922 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -63,4 +63,12 @@ jobs: key: ${{ secrets.NCP_PEM }} port: 22 script: | + CURRENT_PID=$(pgrep -f java) + if [ -z "$CURRENT_PID" ]; then + echo "> no applcation named java is running" + else + echo "> kill -9 java" + kill -9 $CURRENT_PID + sleep 5 + fi nohup java -jar -Dspring.profiles.active=dev -Dnaver.storage.access-key=${{ secrets.ACCESS_KEY }} -Dnaver.storage.secret-key=${{ secrets.SECRET_KEY }} /var/app/app.jar > nohup.log 2> nohup.err < /dev/null & \ No newline at end of file