Skip to content

Commit

Permalink
ci/docs: Add mdbook-linkcheck
Browse files Browse the repository at this point in the history
Fixes containers#521

Signed-off-by: John Eckersberg <jeckersb@redhat.com>
  • Loading branch information
jeckersb committed May 14, 2024
1 parent e3c85ce commit e98292c
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -199,3 +199,33 @@ jobs:
truncate -s 20G ${tmpdisk}
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 \
-v ${tmpdisk}:/disk ${image} bootc install to-disk --via-loopback /disk
docs:
if: ${{ contains(github.event.pull_request.labels.*.name, 'documentation') }}
runs-on: ubuntu-latest
env:
MDBOOK_VERSION: 0.4.37
steps:
- uses: actions/checkout@v4
- name: Install mdBook
run: |
tag=$(curl 'https://api.github.com/repos/rust-lang/mdbook/releases/latest' | jq -r '.tag_name')
url="https://github.com/rust-lang/mdbook/releases/download/${tag}/mdbook-${tag}-x86_64-unknown-linux-gnu.tar.gz"
mkdir mdbook
curl -sSL $url | tar -xz --directory=./mdbook
echo `pwd`/mdbook >> $GITHUB_PATH
- name: Install mdbook-mermaid
run: |
tag=$(curl 'https://api.github.com/repos/badboy/mdbook-mermaid/releases/latest' | jq -r '.tag_name')
url="https://github.com/badboy/mdbook-mermaid/releases/download/${tag}/mdbook-mermaid-${tag}-x86_64-unknown-linux-gnu.tar.gz"
mkdir mdbook-mermaid
curl -sSL $url | tar -xz --directory=./mdbook-mermaid
echo `pwd`/mdbook-mermaid >> $GITHUB_PATH
- name: Install mdbook-linkcheck
run: |
tag=$(curl 'https://api.github.com/repos/Michael-F-Bryan/mdbook-linkcheck/releases/latest' | jq -r '.tag_name')
url="https://github.com/Michael-F-Bryan/mdbook-linkcheck/releases/download/${tag}/mdbook-linkcheck-${tag}-x86_64-unknown-linux-gnu.tar.gz"
mkdir mdbook-linkcheck
curl -sSL $url | tar -xz --directory=./mdbook-linkcheck
echo `pwd`/mdbook-linkcheck >> $GITHUB_PATH
- name: Build with mdBook
run: cd docs && mdbook-mermaid install && mdbook build
7 changes: 7 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@ jobs:
mkdir mdbook-mermaid
curl -sSL $url | tar -xz --directory=./mdbook-mermaid
echo `pwd`/mdbook-mermaid >> $GITHUB_PATH
- name: Install mdbook-linkcheck
run: |
tag=$(curl 'https://api.github.com/repos/Michael-F-Bryan/mdbook-linkcheck/releases/latest' | jq -r '.tag_name')
url="https://github.com/Michael-F-Bryan/mdbook-linkcheck/releases/download/${tag}/mdbook-linkcheck-${tag}-x86_64-unknown-linux-gnu.tar.gz"
mkdir mdbook-linkcheck
curl -sSL $url | tar -xz --directory=./mdbook-linkcheck
echo `pwd`/mdbook-linkcheck >> $GITHUB_PATH
- name: Setup Pages
id: pages
uses: actions/configure-pages@v4
Expand Down
2 changes: 2 additions & 0 deletions docs/book.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ command = "mdbook-mermaid"

[output.html]
additional-js = ["mermaid.min.js", "mermaid-init.js"]

[output.linkcheck]

0 comments on commit e98292c

Please sign in to comment.