Skip to content

Commit

Permalink
docs: add mdbook-linkcheck support
Browse files Browse the repository at this point in the history
Configures the use of mdbook-linkcheck when deploying docs and adds a
CI job that check the docs build when changed.

Signed-off-by: Micah Abbott <miabbott@redhat.com>
  • Loading branch information
miabbott committed May 13, 2024
1 parent 9e424c2 commit 46d00fa
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
14 changes: 13 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ jobs:
- name: Integration tests
run: |
set -xeuo pipefail
image=quay.io/centos-bootc/centos-bootc-dev:stream9
image=quay.io/centos-bootc/centos-bootc-dev:stream9
echo 'ssh-ed25519 ABC0123 testcase@example.com' > test_authorized_keys
sudo podman run --rm --privileged -v ./test_authorized_keys:/test_authorized_keys --env RUST_LOG=debug -v /:/target -v /var/lib/containers:/var/lib/containers -v ./usr/bin/bootc:/usr/bin/bootc --pid=host --security-opt label=disable \
${image} bootc install to-filesystem --acknowledge-destructive \
Expand Down Expand Up @@ -199,3 +199,15 @@ 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
mdbook:
if: ${{ contains(github.event.pull_request.labels.*.name, 'documentation') }}
runs-on: ubuntu-latest
container: quay.io/coreos-assembler/fcos-buildroot:testing-devel
steps:
- uses: actions/checkout@v4
- name: Install deps
run: ./ci/installdeps.sh
- name: Install mdbook dependencies
run: cargo install mdbook mdbook-mermaid mdbook-linkcheck && echo "/github/home/.cargo/bin" >> $GITHUB_PATH
- name: Build docs
run: cd docs && mdbook-mermaid install && mdbook build
8 changes: 8 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@ 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.x86_64-unknown-linux-gnu.zip"
mkdir -p mdbook-linkcheck
curl -sSL $url | unzip -d ./mdbook-linkcheck
chmod +x ./mkdbook_linkcheck/mdbook-linkcheck
echo `pwd`/mdbook-linkcheck >> $GIHUB_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 46d00fa

Please sign in to comment.