CI 修复:简化 SSH 命令为 && 链,确保 mkdir 在 SCP 前执行
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user