forked from Mai-with-u/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (54 loc) · 1.59 KB
/
Copy pathdocs-build.yml
File metadata and controls
66 lines (54 loc) · 1.59 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# Docs Build Check
name: Docs Build Check
on:
pull_request:
branches: [main, dev]
concurrency:
group: docs-build-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
build:
name: Build VitePress docs
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Setup pnpm
uses: pnpm/action-setup@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 24
cache: pnpm
- name: Cache VitePress transform cache
uses: actions/cache@v4
with:
path: .vitepress/cache
key: vitepress-cache-${{ runner.os }}-${{ hashFiles('zh/**', 'en/**', 'public/**', '.vitepress/**', 'pnpm-lock.yaml') }}
restore-keys: |
vitepress-cache-${{ runner.os }}-
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build docs
run: pnpm docs:build
env:
VITEPRESS_VERBOSE: true
- name: Verify build output
run: |
test -f .vitepress/dist/index.html || {
echo "Missing .vitepress/dist/index.html"
exit 1
}
- name: Upload build output on failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: docs-dist-failed
path: .vitepress/dist
if-no-files-found: ignore
retention-days: 3