测试Actions*3
Some checks failed
自动部署 Spring Boot 项目到 CentOS 🚀 / deploy (push) Failing after 38s

This commit is contained in:
huertian 2025-01-08 19:06:53 +08:00
parent 25624fd96b
commit 44598d9baa

View File

@ -35,13 +35,13 @@ jobs:
# 配置 SSH 🔑
echo "$DEPLOY_KEY" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan -H $SERVER_IP >> ~/.ssh/known_hosts
ssh-keyscan -H 8.137.89.177 >> ~/.ssh/known_hosts
# 上传 JAR 包到服务器 📤
scp target/*.jar $USER@$SERVER_IP:/jinduguanli/app.jar
scp target/*.jar root@8.137.89.177:/jinduguanli/app.jar
# 在服务器上重启应用 🔄
ssh $USER@$SERVER_IP << 'EOF'
ssh root@8.137.89.177 << 'EOF'
cd /jinduguanli
pkill -f 'java -jar' || true
nohup java -jar app.jar --spring.config.location=/huertian/application.yml> /huertian/log/app.log 2>&1 &