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 3955b1a commit 144ff99
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 19 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -199,3 +199,8 @@ 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
steps:
- uses: ./.github/workflows/mdbook.yml
20 changes: 1 addition & 19 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,29 +17,11 @@ concurrency:
jobs:
build:
runs-on: ubuntu-latest
env:
MDBOOK_VERSION: 0.4.37
steps:
- uses: actions/checkout@v4
- name: Install mdBook
run: |
tag=$(curl 'https://github.com/gitapi/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://github.com/gitapi/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
- uses: ./.github/workflows/mdbook.yml
- name: Setup Pages
id: pages
uses: actions/configure-pages@v4
- name: Build with mdBook
run: cd docs && mdbook-mermaid install && mdbook build
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/mdbook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Mdbook setup and build workflow

on:
workflow_call:

jobs:
build:
runs-on: ubuntu-latest
env:
MDBOOK_VERSION: 0.4.37
steps:
- uses: actions/checkout@v4
- name: Install mdBook
run: |
tag=$(curl 'https://github.com/gitapi/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://github.com/gitapi/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://github.com/gitapi/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
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 144ff99

Please sign in to comment.