-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #166 from elbeno/fix-docs
⬆️ Update documentation workflow
- Loading branch information
Showing
1 changed file
with
33 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,33 +34,60 @@ jobs: | |
steps: | ||
- name: Checkout source | ||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 | ||
with: | ||
node-version: 20 | ||
|
||
- name: Install Mermaid | ||
run: | | ||
sudo npm install -g @mermaid-js/[email protected] | ||
npx puppeteer browsers install chrome-headless-shell | ||
- name: Install asciidoctor | ||
run: | | ||
sudo apt update | ||
sudo apt install -y asciidoctor | ||
sudo gem install asciidoctor asciidoctor-diagram rouge | ||
- name: Restore CPM cache | ||
env: | ||
cache-name: cpm-cache-0 | ||
id: cpm-cache-restore | ||
uses: actions/cache/restore@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2 | ||
with: | ||
path: ~/cpm-cache | ||
key: ${{runner.os}}-${{env.cache-name}}-${{ hashFiles('**/CMakeLists.txt', 'cmake/**') }} | ||
restore-keys: | | ||
${{runner.os}}-${{env.cache-name}}- | ||
- name: Configure CMake | ||
run: cmake -Bbuild -DCPM_SOURCE_CACHE=~/cpm-cache | ||
|
||
- name: Save CPM cache | ||
env: | ||
cache-name: cpm-cache-0 | ||
if: steps.cpm-cache-restore.outputs.cache-hit != 'true' | ||
uses: actions/cache/save@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2 | ||
with: | ||
path: ~/cpm-cache | ||
key: ${{runner.os}}-${{env.cache-name}}-${{ hashFiles('**/CMakeLists.txt', 'cmake/**') }} | ||
|
||
- name: Build documentation | ||
run: | | ||
mkdir -p ./generated-html | ||
asciidoctor -r asciidoctor-diagram docs/index.adoc -D ./generated-html | ||
if [ -e docs/static ]; then cp -rf docs/static ./generated-html; fi | ||
touch ./generated-html/.nojekyll | ||
ls -la ./generated-html | ||
test $(cmake --build build -v -t docs | grep -c ERROR) == 0 | ||
touch ./build/docs/.nojekyll | ||
ls -la ./build/docs | ||
- name: Setup github pages | ||
if: needs.configure.outputs.enable_publish == 'true' | ||
uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5.0.0 | ||
|
||
- name: Upload artifacts | ||
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1 | ||
with: | ||
path: ./generated-html | ||
path: ${{github.workspace}}/build/docs | ||
|
||
deploy: | ||
needs: [configure, build] | ||
|