Documentation deploy
Local build
npm run build in docs/ runs:
scripts/prepare-assets.mjs- Copies
logo.pngandconfig.yamlinto.vitepress/public-runtime/as the VitePresspublicDir.
- Copies
vitepress build .- Builds
docs/*.mdanddocs/**/*.md. New pages are generated automatically from the matching Markdown files. cleanUrls: trueproduces extensionless paths such asdownloads.html,changelog.html, anden/index.html.- The
sitemapsetting adds every built page tositemap.xml.
- Builds
scripts/prepare-sites-dist.mjs- Outputs
dist/client/(the static site). - The production host is Caddy with
try_filesfallback, so_worker.jsanddist/server/are not produced.
- Outputs
Hosting
- Host:
[email protected]over SSH. - Document root:
/srv/astercore-docs/current, aln -sfntoreleases/<date>-<sha8>. - Web server: Caddy with the clean URL
try_filesfallback. - Front: Cloudflare is set to DYNAMIC; it only fronts and resolves DNS and does not serve static routes or Functions.
Example Caddy site:
caddy
astercore.fubukishop.app {
root * /srv/astercore-docs/current
file_server
try_files {path} {path}.html {path}/index.html
}Deploy commands
sh
cd docs
npm run build
node scripts/deploy-site.mjsPreview with a dry run:
sh
node scripts/deploy-site.mjs --dry-runManual tar+SSH example (the script avoids PowerShell $( ) expansion issues):
sh
dt=$(date +%Y%m%d)
sha=$(git rev-parse --short=8 HEAD)
name=${dt}-${sha}
rel=/srv/astercore-docs/releases/${name}
tar -czf - -C dist/client . | ssh [email protected] \
"mkdir -p ${rel} && tar -xzf - -C ${rel} && cd /srv/astercore-docs && ln -sfn ${name} current"How new routes work
/downloads: createdocs/downloads.md, VitePress buildsdownloads.html; Caddytry_filesserves it as{path}.html./changelog: createdocs/changelog.md, VitePress buildschangelog.html./en/: createdocs/en/index.md, VitePress buildsen/index.html.
try_files {path} {path}.html {path}/index.html handles /downloads, /changelog, /en/, /en, and unknown paths return 404.
The full Traditional Chinese write-up is at 文件發布流程.
