forked from QuestNav/QuestNav
-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (53 loc) · 1.65 KB
/
Copy pathreusable-docs-docs.yml
File metadata and controls
60 lines (53 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
53
54
55
56
57
58
59
60
name: Build Docs
on:
workflow_call:
inputs:
version:
description: 'Version string to use (optional, auto-generated if not provided)'
required: false
type: string
outputs:
artifact-id:
description: 'The artifact ID for the built docs'
value: ${{ jobs.build-docs.outputs.artifact-id }}
jobs:
build-docs:
name: Build Docs
runs-on: ubuntu-latest
outputs:
artifact-id: ${{ steps.upload-docs.outputs.artifact-id }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.ref }}
sparse-checkout: |
docs
.github
sparse-checkout-cone-mode: false
fetch-depth: 0 # Fetch all history for proper versioning
lfs: true
- name: Determine Version
id: version-info
uses: ./.github/actions/determine-version
with:
version: ${{ inputs.version }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22' # Using Node.js 22 LTS (Jod)
cache: 'npm'
cache-dependency-path: 'docs/package-lock.json'
- name: Install dependencies
working-directory: ./docs
run: npm ci
- name: Build website
working-directory: ./docs
run: npm run build
- name: Upload artifact
id: upload-docs
uses: actions/upload-artifact@v4
with:
name: questnav-docs-${{ steps.version-info.outputs.version }}
path: docs/build
retention-days: 7