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:
|
16038
|
21 |
# Build and deploy the documentation of master and the stable/v0.5 branch
|
16021
|
22 |
deploy:
|
|
23 |
runs-on: ubuntu-latest
|
|
24 |
environment:
|
|
25 |
name: github-pages
|
|
26 |
url: ${{ steps.deployment.outputs.page_url }}
|
|
27 |
steps:
|
|
28 |
- name: Install mdbook
|
|
29 |
env:
|
|
30 |
MDBOOK_VERSION: 'v0.4.27'
|
|
31 |
run: |
|
|
32 |
mkdir mdbook
|
|
33 |
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
|
|
34 |
echo `pwd`/mdbook >> $GITHUB_PATH
|
16038
|
35 |
- name: Checkout master
|
|
36 |
uses: actions/checkout@v4
|
|
37 |
with:
|
|
38 |
path: main
|
|
39 |
- name: Checkout stable/v0.5
|
|
40 |
uses: actions/checkout@v4
|
|
41 |
with:
|
|
42 |
path: stable-v0.5
|
|
43 |
ref: 'stable/v0.5'
|
|
44 |
- name: Setup Pages
|
|
45 |
uses: actions/configure-pages@v3
|
|
46 |
- name: Build mdbook for main branch
|
|
47 |
working-directory: 'main/doc'
|
|
48 |
run: mdbook build
|
|
49 |
- name: Build mdbook for stable/v0.5 branch
|
|
50 |
working-directory: 'stable-v0.5/doc'
|
|
51 |
run: mdbook build
|
16021
|
52 |
# Override mdbooks default highlight.js with a custom version containing CMake support.
|
|
53 |
- uses: actions/checkout@v4
|
|
54 |
with:
|
|
55 |
repository: 'highlightjs/highlight.js'
|
|
56 |
# mdbook currently (as of v0.4.27) does not support v11 yet.
|
|
57 |
ref: '10.7.3'
|
|
58 |
path: highlightjs
|
|
59 |
- name: Build custom highlight.js
|
|
60 |
run: |
|
|
61 |
npm install
|
|
62 |
node tools/build.js :common cmake yaml
|
|
63 |
working-directory: highlightjs
|
|
64 |
- name: Override highlightjs
|
|
65 |
run: |
|
16038
|
66 |
cp highlightjs/build/highlight.min.js main/doc/book/highlight.js
|
|
67 |
cp highlightjs/build/highlight.min.js stable-v0.5/doc/book/highlight.js
|
|
68 |
- name: Copy stable doc into main
|
|
69 |
run: mkdir main/doc/book/v0.5 && cp -a stable-v0.5/doc/book/. main/doc/book/v0.5/
|
|
70 |
- name: Debug print
|
|
71 |
run: ls -la main/doc/book/v0.5
|
16021
|
72 |
- name: Upload artifact
|
16038
|
73 |
uses: actions/upload-pages-artifact@v2
|
16021
|
74 |
with:
|
16038
|
75 |
path: 'main/doc/book'
|
16021
|
76 |
- name: Deploy to GitHub Pages
|
|
77 |
id: deployment
|
16038
|
78 |
uses: actions/deploy-pages@v2
|