CI 修复:简化 SSH 命令为 && 链,确保 mkdir 在 SCP 前执行

This commit is contained in:
2569718930@qq.com
2026-05-26 03:11:10 +08:00
parent e1bad1bcfa
commit 2e8349a2c9
+2 -12
View File
@@ -85,16 +85,6 @@ jobs:
mkdir -p ~/.ssh
echo "${{ secrets.VPS_SSH_KEY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh -o StrictHostKeyChecking=accept-new ${{ secrets.VPS_USER }}@${{ secrets.VPS_HOST }} "
cd /root/PolyWeather
git fetch origin main && git reset --hard origin/main
mkdir -p frontend
"
ssh -o StrictHostKeyChecking=accept-new ${{ secrets.VPS_USER }}@${{ secrets.VPS_HOST }} "cd /root/PolyWeather && git fetch origin main && git reset --hard origin/main && mkdir -p frontend"
scp -o StrictHostKeyChecking=accept-new -r frontend/.next frontend/package.json frontend/package-lock.json frontend/next.config.mjs ${{ secrets.VPS_USER }}@${{ secrets.VPS_HOST }}:/root/PolyWeather/frontend/
ssh -o StrictHostKeyChecking=accept-new ${{ secrets.VPS_USER }}@${{ secrets.VPS_HOST }} "
cd /root/PolyWeather
docker compose down
docker compose up -d --build
sleep 10
curl -s http://localhost:8000/healthz
"
ssh -o StrictHostKeyChecking=accept-new ${{ secrets.VPS_USER }}@${{ secrets.VPS_HOST }} "cd /root/PolyWeather && docker compose down && docker compose up -d --build && sleep 10 && curl -s http://localhost:8000/healthz"