- GitHub Actions 不稳定
- 网络环境复杂
- 需要快速、可控发布
rm -rf dist && npm ci && npm run build && \
tar --no-xattrs --no-mac-metadata --exclude=.git -czf web.tgz dist && \
scp -i ~/.ssh/gh_actions_deploy ./web.tgz root@123.57.172.165:/tmp/weather-web.tgzssh -i ~/.ssh/gh_actions_deploy root@123.57.172.165 '
set -e
sudo mkdir -p /var/www/weather-web
sudo rm -rf /var/www/weather-web/*
sudo tar -xzf /tmp/weather-web.tgz -C /var/www/weather-web --strip-components=1
sudo nginx -t
sudo nginx -s reload
echo "✅ frontend deployed: $(date)"
'