#!/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. # # Run inside a node:20 container by .gitea/workflows/deploy-site.yml; this # script itself just runs npm and assumes it is invoked from the repo root. set -euo pipefail SITE_URL="${SITE_URL:-https://pangolin.yanmeiai.com}" export SITE_URL echo "==> compile-site: SITE_URL=${SITE_URL}" cd web/website npm ci npm run build echo "==> compile-site: done — dist/ contents:" ls -lh dist/