#!/usr/bin/env bash # compile-site.sh — build the Astro 官网 (web/website) as a static site. # Output: web/website/dist/. Canonical domain is injected via SITE_URL (see # web/website/astro.config.mjs) — must match the deploy target host name so # canonical URLs / sitemap resolve correctly. # # 由 .gitea/workflows/deploy-site.yml 在 ubuntu runner 上从 repo 根调用(runner # 镜像自带 node/npx,直接跑)。source _env.sh 取 npm 国内镜像 + 重试助手(墙内)。 set -euo pipefail # shellcheck source=scripts/ci/_env.sh . scripts/ci/_env.sh SITE_URL="${SITE_URL:-https://pangolin.yanmeiai.com}" export SITE_URL echo "==> compile-site: SITE_URL=${SITE_URL} NPM_CONFIG_REGISTRY=${NPM_CONFIG_REGISTRY}" cd web/website npm_ci_retry npm run build echo "==> compile-site: done — dist/ contents:" ls -lh dist/