fix: improve blue-green deployment with rollback, graceful reload, and volume isolation

This commit is contained in:
NetworkCats
2026-03-05 23:38:23 +08:00
parent 71d4129179
commit 282c07b8cd
4 changed files with 101 additions and 52 deletions
+10 -1
View File
@@ -150,7 +150,16 @@ jobs:
mkdir -p ~/.ssh
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/deploy_key
chmod 600 ~/.ssh/deploy_key
ssh-keyscan -H "${{ steps.vps.outputs.ip }}" >> ~/.ssh/known_hosts 2>/dev/null || true
for i in 1 2 3; do
if ssh-keyscan -H "${{ steps.vps.outputs.ip }}" >> ~/.ssh/known_hosts 2>/dev/null; then
echo "ssh-keyscan succeeded on attempt $i"
exit 0
fi
echo "ssh-keyscan attempt $i failed, retrying in 10s..."
sleep 10
done
echo "ssh-keyscan failed after 3 attempts"
exit 1
# ---- Detect first deployment ----
- name: Detect first deployment