16021
|
1 |
name: Deploy GH pages
|
|
2 |
on:
|
|
3 |
push:
|
|
4 |
branches:
|
|
5 |
- master
|
|
6 |
# Allows you to run this workflow manually from the Actions tab
|
|
7 |
workflow_dispatch:
|
|
8 |
|
|
9 |
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
|
|
10 |
permissions:
|
|
11 |
contents: read
|
|
12 |
pages: write
|
|
13 |
id-token: write
|
|
14 |
|
|
15 |
# Allow one concurrent deployment
|
|
16 |
concurrency:
|
|
17 |
group: "pages"
|
|
18 |
cancel-in-progress: true
|
|
19 |
|
|
20 |
jobs:
|
|
21 |
deploy:
|
|
22 |
runs-on: ubuntu-latest
|
|
23 |
environment:
|
|
24 |
name: github-pages
|
|
25 |
url: ${{ steps.deployment.outputs.page_url }}
|
|
26 |
steps:
|
|
27 |
- uses: actions/checkout@v4
|
|
28 |
- name: Setup Pages
|
|
29 |
uses: actions/configure-pages@v3
|
|
30 |
- name: Install mdbook
|
|
31 |
env:
|
|
32 |
MDBOOK_VERSION: 'v0.4.27'
|
|
33 |
run: |
|
|
34 |
mkdir mdbook
|
|
35 |
curl -sSL https://github.com/rust-lang/mdBook/releases/download/${MDBOOK_VERSION}/mdbook-${MDBOOK_VERSION}-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=./mdbook
|
|
36 |
echo `pwd`/mdbook >> $GITHUB_PATH
|
|
37 |
- name: Build mdbook
|
|
38 |
run: |
|
|
39 |
cd doc
|
|
40 |
mdbook build
|
|
41 |
# Override mdbooks default highlight.js with a custom version containing CMake support.
|
|
42 |
- uses: actions/checkout@v4
|
|
43 |
with:
|
|
44 |
repository: 'highlightjs/highlight.js'
|
|
45 |
# mdbook currently (as of v0.4.27) does not support v11 yet.
|
|
46 |
ref: '10.7.3'
|
|
47 |
path: highlightjs
|
|
48 |
- name: Build custom highlight.js
|
|
49 |
run: |
|
|
50 |
npm install
|
|
51 |
node tools/build.js :common cmake yaml
|
|
52 |
working-directory: highlightjs
|
|
53 |
- name: Override highlightjs
|
|
54 |
run: |
|
|
55 |
cp highlightjs/build/highlight.min.js doc/book/highlight.js
|
|
56 |
- name: Upload artifact
|
|
57 |
uses: actions/upload-pages-artifact@v1
|
|
58 |
with:
|
|
59 |
path: 'doc/book'
|
|
60 |
- name: Deploy to GitHub Pages
|
|
61 |
id: deployment
|
|
62 |
uses: actions/deploy-pages@v1
|