#!/usr/bin/env bash # deploy-site.sh — rsync the built Astro 官网 (web/website/dist/) to the # pangolin1 VPS web root (/var/www/pangolin-site). Deploy user is root — the # CI deploy key (secrets.DEPLOY_SSH_KEY) is authorized for root on the host. # Static files only; nginx/caddy serves them directly, no service restart # needed. Assumes it is invoked from the repo root, after compile-site.sh has # produced web/website/dist/. set -euo pipefail # shellcheck source=scripts/ci/lib-ssh.sh . scripts/ci/lib-ssh.sh setup_ssh trap teardown_ssh EXIT DEPLOY_TARGET="root@${DEPLOY_HOST}:/var/www/pangolin-site/" echo "==> deploy-site: rsync web/website/dist/ -> ${DEPLOY_TARGET}" rsync -az --delete -e "${RSYNC_SSH}" web/website/dist/ "${DEPLOY_TARGET}" echo "==> deploy-site: done"