File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -39,27 +39,17 @@ jobs:
3939 restart.sh
4040 target : " ${{ secrets.SERVER_PROJECT_PATH }}"
4141
42- # 设置 restart.sh 权限
43- - name : Set permissions for restart.sh
42+ # 执行 restart.sh
43+ - name : perform restart.sh
4444 uses : appleboy/ssh-action@v1.1.0
4545 with :
4646 host : ${{ secrets.SERVER_HOST }}
4747 username : ${{ secrets.SERVER_USER }}
4848 port : ${{ secrets.SERVER_PORT }}
4949 key : ${{ secrets.SERVER_SSH_KEY }}
5050 script : |
51- chmod 755 ${{ secrets.SERVER_PROJECT_PATH }}restart.sh
52-
53- # 调用服务器的 restart.sh 重启项目
54- - name : Restart Spring Boot app
55- uses : appleboy/ssh-action@v1.1.0
56- with :
57- host : ${{ secrets.SERVER_HOST }}
58- username : ${{ secrets.SERVER_USER }}
59- port : ${{ secrets.SERVER_PORT }}
60- key : ${{ secrets.SERVER_SSH_KEY }}
61- script : |
6251 cd ${{ secrets.SERVER_PROJECT_PATH }}
52+ chmod 755 restart.sh
6353 # 获取最新 jar 文件名
6454 LATEST_JAR=$(ls -t *.jar | head -n 1)
6555 echo "最新 jar 包:$LATEST_JAR"
6959 sed -i "s|^APP_PATH=.*|APP_PATH=\"${{ secrets.SERVER_PROJECT_PATH }}\"|" restart.sh
7060
7161 echo "执行重启脚本..."
72- bash -l restart.sh
62+ bash -l restart.sh
You can’t perform that action at this time.
0 commit comments