diff --git a/.gitea/workflows/build-deploy.yaml b/.gitea/workflows/build-deploy.yaml index 4feba64..8a09ff3 100644 --- a/.gitea/workflows/build-deploy.yaml +++ b/.gitea/workflows/build-deploy.yaml @@ -45,5 +45,16 @@ jobs: username: ${{ secrets.SERVER_USERNAME }} password: ${{ secrets.SERVER_PASSWORD }} port: ${{ secrets.SERVER_PORT }} - source: "target/*.jar" - target: "/home/tools/testActions" + source: target/*.jar + target: /home/tools/${{ var.APP_NAME }}/package + # 停止远程服务进程 + - name: 使用新版jar包启动应用 + uses: appleboy/ssh-action@master + with: + host: ${{ secrets.SERVER_HOST }} + username: ${{ secrets.SERVER_USERNAME }} + password: ${{ secrets.SERVER_PASSWORD }} + port: ${{ secrets.SERVER_PORT }} + script: | + "if screen -list | grep -q '${{ var.APP_NAME }}'; then screen -S ${{ var.APP_NAME }} -X quit && echo 'Screen session PetGuardian stopped.'; else echo 'No screen session named PetGuardian found.'; fi" + screen -dmS PetGuardian /usr/local/java/jdk1.8.0_202/bin/java -jar ${{ var.APP_NAME }}-0.0.1-SNAPSHOT.jar