-
Notifications
You must be signed in to change notification settings - Fork 51
87 lines (72 loc) · 2.03 KB
/
documentation.yaml
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
78
79
80
81
82
83
84
85
86
87
name: Build & Deploy Documentation
on:
push:
branches:
- master
jobs:
generate-reference:
runs-on: ubuntu-latest
container: sogno/dpsim:dev
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Create Build Environment
run: mkdir build
- name: Configure CMake
shell: bash
working-directory: ${{github.workspace}}/build
run: cmake $GITHUB_WORKSPACE
- name: Make reference docs
run: |
make --jobs $(nproc) -C build docs
make --jobs $(nproc) -C build docs_cxx
- name: Copy reference
run: |
mkdir reference
cp -r build/docs/sphinx/html/. reference/sphinx
cp -r build/docs/doxygen/html/. reference/doxygen
- name: Archive reference directory
uses: actions/upload-artifact@v4
with:
path: ${{ github.workspace }}/reference
name: reference-cache
retention-days: 1
deploy:
runs-on: ubuntu-latest
needs: [generate-reference]
steps:
- uses: actions/checkout@v4
- name: Setup Hugo
uses: peaceiris/actions-hugo@v3
with:
hugo-version: '0.108.0'
extended: true
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Cache dependencies
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- run: cd docs/hugo && npm ci
- run: cd docs/hugo && hugo --minify
- name: Restore reference archive
uses: actions/download-artifact@v4
with:
name: reference-cache
path: ${{ github.workspace }}/reference
- name: Copy docs
run: |
cp -r reference/. public
cp -r docs/hugo/public/. public
- name: Deploy page
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public
# keep_files: true
publish_branch: gh-pages