-
Notifications
You must be signed in to change notification settings - Fork 568
77 lines (66 loc) · 2.02 KB
/
generate-documentation.yml
File metadata and controls
77 lines (66 loc) · 2.02 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
67
68
69
70
71
72
73
74
75
76
77
name: Generate Documentation
on:
workflow_call:
inputs:
git_ref:
description: 'Git ref to checkout (branch, tag, or commit SHA)'
required: true
type: string
env:
GIT_REF: ${{ inputs.git_ref }}
jobs:
generate-documentation:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [22.x]
steps:
- uses: actions/checkout@v4
with:
ref: ${{ env.GIT_REF }}
fetch-depth: 0
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Setup npm version 10
run: |
npm i -g npm@10 --registry=https://registry.npmjs.org
- name: Cache node modules
id: cache-nodemodules
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
# caching node_modules
path: |
node_modules
*/*/node_modules
key: ${{ runner.os }}-deps-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-deps-${{ matrix.node-version }}-
- name: Install Dependencies
if: steps.cache-nodemodules.outputs.cache-hit != 'true'
run: npm ci
- run: npm run build
- name: Generate Documentation
run: npm run docgen
- name: Upload documentation files as artifact
id: docs-artifact
uses: actions/upload-pages-artifact@v3
with:
path: docs/
retention-days: 10
deploy-docs-pages:
permissions:
id-token: write # Needed for OIDC authentication
pages: write # this permission is needed for deploying into Github Pages
environment:
name: github-pages
url: ${{ steps.docs-artifact.outputs.page_url }}
runs-on: ubuntu-latest
needs: generate-documentation
steps:
- name: Deploy to Documentation to GitHub Pages
id: docs-artifact
uses: actions/deploy-pages@v4