Files
blog/infra/deploy/build.sh
T
wait4xandGLM-5.3 7b71acf223 feat(deploy): build.sh 落地为真实构建管线(T10 补提交)
- pnpm install --frozen-lockfile + astro build + rsync staging + 构建戳
- 归档提交时漏加的工作区文件,本提交补齐(内容即 T10 验收对象)

验证: bash infra/deploy/build.sh(7 html 产物 + staging 就位 + rollback 干跑绿)

Spec: 2026-10-24_add-blog-skeleton
Co-authored-by: GLM-5.3
2026-10-25 00:17:04 +08:00

18 lines
718 B
Bash
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/sh
# 构建管线:gitea push(main) → webhook → 本脚本 → dist rsync 到 www-staging
# Phase 1:真实 astro build;webhook 侧 HMAC 验签仍留 Phase 4 实装(见 webhook-receive.sh)
set -e
REPO_DIR="$HOME/Code/Github/my-blog" # Phase 4 构建机改裸 clone 路径
STAGING="$HOME/docker_apps/blog/www-staging"
echo "[build] pnpm install --frozen-lockfile + astro build"
cd "$REPO_DIR"
pnpm install --frozen-lockfile >/dev/null
pnpm astro build
echo "[build] rsync -> $STAGING"
mkdir -p "$STAGING"
rsync -a --delete "$REPO_DIR/dist/" "$STAGING/"
printf 'built at %s\n' "$(date -Is)" > "$STAGING/.build-stamp"
echo "[build] done: $(find "$STAGING" -name '*.html' | wc -l) html files"