9bac5c8dcb
- scripts/ci/compile-site.sh: node:20 容器内构建 web/website(Astro), SITE_URL 注入 canonical 域名 https://pangolin.yanmeiai.com。 - scripts/ci/lib-ssh.sh: 新增共享 setup_ssh/teardown_ssh(写临时私钥+ known_hosts),供 site 与后续 server 部署复用;目标写死 IP 103.119.13.48 (runner 无法解析用户本机 ~/.ssh/config 的 pangolin1 别名)。 - scripts/ci/deploy-site.sh: rsync dist/ 到 pangolin1 /var/www/pangolin-site/,root 部署。 - .gitea/workflows/deploy-site.yml: site-v* tag + workflow_dispatch 触发, concurrency 组 deploy-site 防并发。 - .gitea/workflows/ci.yml: shellcheck 列表纳入三个新脚本。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013nMthbVEmQquxBRKb9Fj8u
21 lines
686 B
Bash
Executable File
21 lines
686 B
Bash
Executable File
#!/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/
|