fix: 修复服务器部署失败 — rsync 前确保远程目录存在

Co-authored-by: qinfendebingshuo <207279273+qinfendebingshuo@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2026-03-07 10:35:43 +00:00
parent 0c8abf78c3
commit ff3e459202
1 changed files with 12 additions and 0 deletions

View File

@ -115,6 +115,18 @@ jobs:
exit 1; }); }"
echo "✅ 远程服务器 rsync 检查完成"
- name: 📁 确保远程部署目录存在
run: |
echo "🔍 检查远程部署目录..."
ssh -i ~/.ssh/deploy_key \
"${{ secrets.DEPLOY_USER }}@${{ secrets.DEPLOY_HOST }}" \
"mkdir -p '${{ secrets.DEPLOY_PATH }}'" || {
echo "❌ 无法创建远程部署目录SSH 连接失败或权限不足)"
echo "请确认 DEPLOY_PATH 设置正确且 DEPLOY_USER 有写入权限"
exit 1
}
echo "✅ 远程部署目录已就绪"
- name: 🔒 部署前安全检查
run: |
if [ ! -f "docs/index.html" ]; then