@@ -34,33 +34,60 @@ jobs:
3434 steps :
3535 - name : Checkout source
3636 uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
37+
3738 - name : Setup Node.js
3839 uses : actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
3940 with :
4041 node-version : 20
42+
4143 - name : Install Mermaid
4244 run : |
4345 sudo npm install -g @mermaid-js/[email protected] 4446 npx puppeteer browsers install chrome-headless-shell
47+
4548 - name : Install asciidoctor
4649 run : |
4750 sudo apt update
4851 sudo apt install -y asciidoctor
4952 sudo gem install asciidoctor asciidoctor-diagram rouge
53+
54+ - name : Restore CPM cache
55+ env :
56+ cache-name : cpm-cache-0
57+ id : cpm-cache-restore
58+ uses : actions/cache/restore@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
59+ with :
60+ path : ~/cpm-cache
61+ key : ${{runner.os}}-${{env.cache-name}}-${{ hashFiles('**/CMakeLists.txt', 'cmake/**') }}
62+ restore-keys : |
63+ ${{runner.os}}-${{env.cache-name}}-
64+
65+ - name : Configure CMake
66+ run : cmake -Bbuild -DCPM_SOURCE_CACHE=~/cpm-cache
67+
68+ - name : Save CPM cache
69+ env :
70+ cache-name : cpm-cache-0
71+ if : steps.cpm-cache-restore.outputs.cache-hit != 'true'
72+ uses : actions/cache/save@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
73+ with :
74+ path : ~/cpm-cache
75+ key : ${{runner.os}}-${{env.cache-name}}-${{ hashFiles('**/CMakeLists.txt', 'cmake/**') }}
76+
5077 - name : Build documentation
5178 run : |
52- mkdir -p ./generated-html
53- asciidoctor -r asciidoctor-diagram docs/index.adoc -D ./generated-html
54- if [ -e docs/static ]; then cp -rf docs/static ./generated-html; fi
55- touch ./generated-html/.nojekyll
56- ls -la ./generated-html
79+ test $(cmake --build build -v -t docs | grep -c ERROR) == 0
80+ touch ./build/docs/.nojekyll
81+ ls -la ./build/docs
82+
5783 - name : Setup github pages
5884 if : needs.configure.outputs.enable_publish == 'true'
5985 uses : actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5.0.0
86+
6087 - name : Upload artifacts
6188 uses : actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1
6289 with :
63- path : ./generated-html
90+ path : ${{github.workspace}}/build/docs
6491
6592 deploy :
6693 needs : [configure, build]
0 commit comments