Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 13 additions & 29 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,15 @@ concurrency:
cancel-in-progress: false

jobs:
validate:
uses: ./.github/workflows/validate.yml
with:
upload-dist: true
secrets:
UMAMI_API_KEY: ${{ secrets.UMAMI_API_KEY }}

deploy:
needs: validate
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
Expand All @@ -21,38 +29,14 @@ jobs:
with:
persist-credentials: false

- name: Enable Corepack
run: corepack enable

- name: Setup Node.js
uses: actions/setup-node@v5
with:
node-version: '24.13.0'
cache: 'pnpm'

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Cache Astro assets
uses: actions/cache@v5
- name: Download the tested production site
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2, Node 24
with:
path: node_modules/.astro
key: ${{ runner.os }}-astro-${{ hashFiles('pnpm-lock.yaml') }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-astro-${{ hashFiles('pnpm-lock.yaml') }}-
${{ runner.os }}-astro-

- name: Validate source and content
run: |
pnpm test:unit
pnpm type-check
pnpm test:markdown
name: validated-dist
path: dist

- name: Build and package site
env:
UMAMI_API_KEY: ${{ secrets.UMAMI_API_KEY }}
- name: Package committed source with validated site
run: |
pnpm build
git archive --format=tar --output=site-source.tar HEAD
tar -rf site-source.tar dist

Expand Down
99 changes: 99 additions & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
name: Validate blog

on:
pull_request:
branches: [main]
workflow_dispatch:
inputs:
extended:
description: Also test Firefox and WebKit
type: boolean
default: true
schedule:
- cron: '20 20 * * 0' # Monday 04:20 in Singapore
workflow_call:
inputs:
upload-dist:
type: boolean
default: false
extended:
type: boolean
default: false
secrets:
UMAMI_API_KEY:
required: false

permissions:
contents: read

concurrency:
group: validate-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
checks:
# Goldens and compositor captures use Windows, matching local reviewed baselines.
# Deploy still runs on Linux and consumes this exact validated static directory.
runs-on: windows-2025
timeout-minutes: 30
env:
BROWSER_MATRIX: ${{ (github.event_name == 'schedule' || inputs.extended) && 'extended' || 'primary' }}
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1, Node 24
with:
persist-credentials: false
- name: Enable Corepack
run: corepack enable
- name: Setup Node.js
uses: actions/setup-node@v5
with:
node-version: '24.13.0'
cache: pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Cache Astro assets
uses: actions/cache@v5
with:
path: node_modules/.astro
key: ${{ runner.os }}-astro-${{ hashFiles('pnpm-lock.yaml') }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-astro-${{ hashFiles('pnpm-lock.yaml') }}-
- name: Unit tests
run: pnpm test:unit
- name: Astro type checks
run: pnpm type-check
- name: Markdown and MDX integration
run: pnpm test:markdown
# Both commands write dist: this clean build must follow integration, never overlap it.
- name: Build production site and verify output
env:
UMAMI_API_KEY: ${{ secrets.UMAMI_API_KEY }}
run: pnpm build
- name: Install Chromium
run: pnpm exec playwright install chromium
- name: Install additional engines
if: env.BROWSER_MATRIX == 'extended'
run: pnpm exec playwright install firefox webkit
- name: Browser interaction, motion and visual regression
run: pnpm test:browser
- name: Preserve browser diagnostics
if: ${{ !cancelled() }}
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7, Node 24
with:
name: browser-report-${{ github.run_id }}-${{ github.run_attempt }}
path: |
playwright-report/
test-results/
if-no-files-found: ignore
retention-days: 7
compression-level: 0 # PNG/video/trace files are already compressed.
- name: Preserve validated site for deployment
if: inputs.upload-dist
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7, Node 24
with:
name: validated-dist
path: dist/
if-no-files-found: error
retention-days: 1
compression-level: 0
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ dist/
/audit/
*.log

# browser regression diagnostics (reviewed golden images live in tests/browser/snapshots)
/playwright-report/
/test-results/

# private config
.env
.env.*
Expand Down
17 changes: 17 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,20 @@ reduced motion, browser return navigation, and failure states. Run the project's
pnpm unit, Markdown/MDX integration, type, and production build checks before
delivery. Integration tests and production builds both write dist: run them
sequentially. Retain theme/upstream attribution and local font licenses.

Read [MAINTENANCE.md](MAINTENANCE.md) for module ownership, motion history and
deployment constraints. Run `pnpm test:browser` against the normal production
build; [tests/browser/README.md](tests/browser/README.md) explains the browser
matrix, animation probes, screenshots and diagnostics. Source-pattern unit
tests alone do not establish visual correctness. Never update screenshot
baselines just to make a failing test pass; inspect actual/expected/diff images.

Keep Home title motion exclusively in `voyage.ts`. Incoming CSS preparation,
after-swap title animation and post-transition interaction setup serve different
lifecycle phases. Preserve the narrowly scoped Home root opacity fix, real-sky
additive blending, planet grain and generation/abort guards. Consult the motion
decision history before simplifying these paths.

Changes to architecture, lifecycle, dependencies, commands, tests or deployment
must update the affected maintenance/test documentation in the same change.
Report checks actually run, browser/viewport coverage and remaining limitations.
2 changes: 2 additions & 0 deletions CMS_SETUP.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,5 @@ GitHub OAuth 应用设置:
认证服务仅在 Docker 内网开放,Nginx 转发 /oauth 与 /oauth/callback;/oauth/health 可检查服务是否已读取凭据。登录只允许 Chen017,并检查目标仓库写权限。OAuth 的 public_repo 授权范围并不只限这一个公开仓库;改私有仓库或增加编辑账号需相应调整并复核。

部署会同步代码删除,保留服务器 .env、Git、依赖和缓存目录。缺少 rsync 时,root 权限的 Debian/Ubuntu 主机会自动安装;其他系统需自行提供 rsync。

main 推送先调用共享验证流程,依次完成单元、类型、Markdown/MDX、正常生产构建与浏览器回归检查;验证通过后,部署下载同一次运行的 `validated-dist`,不在服务器重复构建。检查失败时网站不会进入后续部署步骤。工作流触发条件、必要 Secrets、诊断产物与回退方法统一记录在 [MAINTENANCE.md](MAINTENANCE.md) 的 CI/CD 部分。
6 changes: 6 additions & 0 deletions DESIGN_SYSTEM.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,12 @@ One short homepage opening may run on the first visit of a browser session; keep
all content immediately visible, skip it on history return and reduced motion,
without a replay control. Scroll-linked decoration follows native scrolling
and never captures wheel or touch input.
The shorter Home return entrance is separate from that first-session opening:
both `Etalib’s` and `Space.` start from their prepared poses during the incoming
slide. Preserve the existing stagger (110ms + 580ms and 190ms + 820ms), without
restarting at transition completion. CSS must establish the initial poses before
snapshot capture; removing that preparation creates a visible downward jump.
See `MAINTENANCE.md` for ownership and the historical regression decisions.
Parallax photography must overscan by at least its full travel on every screen
width; use explicit 20px horizontal / 14px vertical overscan rather than a scale
factor whose margin becomes insufficient in a narrow window.
Expand Down
Loading