diff --git a/.github/workflows/springboot-on-push.yaml b/.github/workflows/springboot-on-push.yaml index 42a67cf5..7636f044 100644 --- a/.github/workflows/springboot-on-push.yaml +++ b/.github/workflows/springboot-on-push.yaml @@ -52,7 +52,7 @@ jobs: - name: Execute remote commands run: | ssh -v ${{ secrets.SPRINGBOOT_USERNAME }}@${{ secrets.SPRINGBOOT_HOST_DNS }} \ - "pkill -f 'java -jar ${{ secrets.SPRINGBOOT_TARGET_DIR }}/*.jar' || true && \ + "sudo lsof -t -i tcp:8080 | sargs sudo kill -9 || true && \ cd ${{ secrets.SPRINGBOOT_ROOT_DIR }} && pwd && \ sudo nohup /usr/bin/java -jar ${{ secrets.SPRINGBOOT_TARGET_DIR }}/*.jar \ > ${{ secrets.SPRINGBOOT_ROOT_DIR }}/app.log 2>&1 &"