Repository navigation
52 lines (47 loc) · 1.65 KB
/
Copy pathdocs.yml
File metadata and controls
52 lines (47 loc) · 1.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: Docs Build Check
# Docs are HOSTED on Cloudflare Pages (cosy-docs-4f5.pages.dev, deployed via
# wrangler from a machine with CF credentials — see docs deploy guide).
# GitHub Pages was never enabled for this repo, so the old push-triggered
# deploy workflow failed on every main push (issue #123).
#
# This workflow now runs on demand only (workflow_dispatch) and just verifies
# the VitePress build succeeds, uploading the built site as a regular artifact.
on:
workflow_dispatch:
permissions:
contents: read
concurrency:
group: docs-build-check
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- run: bun install
working-directory: docs
- name: Build docs (fail on render errors)
working-directory: docs
run: |
# vitepress prints SSR render errors but still exits 0, leaving blank pages
set -o pipefail
bun run build 2>&1 | tee build.log
if grep -qE "(TypeError|ReferenceError|SyntaxError|\[vitepress\].*error)" build.log; then
echo "::error::Docs build logged render errors (see above)."
exit 1
fi
- name: Verify build output
run: |
if [ ! -d "docs/.vitepress/dist" ] || [ -z "$(ls -A docs/.vitepress/dist)" ]; then
echo "::error::Build output is empty or missing."
exit 1
fi
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: docs-dist
path: docs/.vitepress/dist
retention-days: 7