Skip to content

Commit 4f2a30c

Browse files
committed
ci/docs: Add mdbook-linkcheck
Fixes #521 Signed-off-by: John Eckersberg <[email protected]>
1 parent e3c85ce commit 4f2a30c

File tree

3 files changed

+41
-0
lines changed

3 files changed

+41
-0
lines changed

.github/workflows/ci.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,3 +199,34 @@ jobs:
199199
truncate -s 20G ${tmpdisk}
200200
sudo podman run --rm --privileged --env RUST_LOG=debug -v /dev:/dev -v /:/target -v /var/lib/containers:/var/lib/containers -v ./usr/bin/bootc:/usr/bin/bootc --pid=host --security-opt label=disable \
201201
-v ${tmpdisk}:/disk ${image} bootc install to-disk --via-loopback /disk
202+
docs:
203+
if: ${{ contains(github.event.pull_request.labels.*.name, 'documentation') }}
204+
runs-on: ubuntu-latest
205+
env:
206+
MDBOOK_VERSION: 0.4.37
207+
steps:
208+
- uses: actions/checkout@v4
209+
- name: Install mdBook
210+
run: |
211+
tag=$(curl 'https://api.github.com/repos/rust-lang/mdbook/releases/latest' | jq -r '.tag_name')
212+
url="https://github.com/rust-lang/mdbook/releases/download/${tag}/mdbook-${tag}-x86_64-unknown-linux-gnu.tar.gz"
213+
mkdir mdbook
214+
curl -sSL $url | tar -xz --directory=./mdbook
215+
echo `pwd`/mdbook >> $GITHUB_PATH
216+
- name: Install mdbook-mermaid
217+
run: |
218+
tag=$(curl 'https://api.github.com/repos/badboy/mdbook-mermaid/releases/latest' | jq -r '.tag_name')
219+
url="https://github.com/badboy/mdbook-mermaid/releases/download/${tag}/mdbook-mermaid-${tag}-x86_64-unknown-linux-gnu.tar.gz"
220+
mkdir mdbook-mermaid
221+
curl -sSL $url | tar -xz --directory=./mdbook-mermaid
222+
echo `pwd`/mdbook-mermaid >> $GITHUB_PATH
223+
- name: Install mdbook-linkcheck
224+
run: |
225+
tag=$(curl 'https://api.github.com/repos/Michael-F-Bryan/mdbook-linkcheck/releases/latest' | jq -r '.tag_name')
226+
archive="mdbook-linkcheck.x86_64-unknown-linux-gnu.zip"
227+
url="https://github.com/Michael-F-Bryan/mdbook-linkcheck/releases/download/${tag}/${archive}"
228+
mkdir mdbook-linkcheck
229+
curl -sSL -O $url && unzip ${archive} -d ./mdbook-linkcheck && chmod +x ./mdbook-linkcheck/mdbook-linkcheck
230+
echo `pwd`/mdbook-linkcheck >> $GITHUB_PATH
231+
- name: Build with mdBook
232+
run: cd docs && mdbook-mermaid install && mdbook build

.github/workflows/docs.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,14 @@ jobs:
3535
mkdir mdbook-mermaid
3636
curl -sSL $url | tar -xz --directory=./mdbook-mermaid
3737
echo `pwd`/mdbook-mermaid >> $GITHUB_PATH
38+
- name: Install mdbook-linkcheck
39+
run: |
40+
tag=$(curl 'https://api.github.com/repos/Michael-F-Bryan/mdbook-linkcheck/releases/latest' | jq -r '.tag_name')
41+
archive="mdbook-linkcheck.x86_64-unknown-linux-gnu.zip"
42+
url="https://github.com/Michael-F-Bryan/mdbook-linkcheck/releases/download/${tag}/${archive}"
43+
mkdir mdbook-linkcheck
44+
curl -sSL -O $url && unzip ${archive} -d ./mdbook-linkcheck && chmod +x ./mdbook-linkcheck/mdbook-linkcheck
45+
echo `pwd`/mdbook-linkcheck >> $GITHUB_PATH
3846
- name: Setup Pages
3947
id: pages
4048
uses: actions/configure-pages@v4

docs/book.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,5 @@ command = "mdbook-mermaid"
1010

1111
[output.html]
1212
additional-js = ["mermaid.min.js", "mermaid-init.js"]
13+
14+
[output.linkcheck]

0 commit comments

Comments
 (0)