action.yml

 1name: "Build docs"
 2description: "Build the docs"
 3
 4runs:
 5  using: "composite"
 6  steps:
 7    - name: Setup mdBook
 8      uses: peaceiris/actions-mdbook@ee69d230fe19748b7abf22df32acaa93833fad08 # v2
 9      with:
10        mdbook-version: "0.4.37"
11
12    - name: Cache dependencies
13      uses: swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6 # v2
14      with:
15        save-if: ${{ github.ref == 'refs/heads/main' }}
16        # cache-provider: "buildjet"
17
18    - name: Install Linux dependencies
19      shell: bash -euxo pipefail {0}
20      run: ./script/linux
21
22    - name: Install mold linker
23      shell: bash -euxo pipefail {0}
24      run: ./script/install-mold
25
26    - name: Download WASI SDK
27      shell: bash -euxo pipefail {0}
28      run: ./script/download-wasi-sdk
29
30    - name: Generate action metadata
31      shell: bash -euxo pipefail {0}
32      run: ./script/generate-action-metadata
33
34    - name: Check for broken links (in MD)
35      uses: lycheeverse/lychee-action@82202e5e9c2f4ef1a55a3d02563e1cb6041e5332 # v2.4.1
36      with:
37        args: --no-progress --exclude '^http' './docs/src/**/*'
38        fail: true
39
40    - name: Build book
41      shell: bash -euxo pipefail {0}
42      run: |
43        mkdir -p target/deploy
44        mdbook build ./docs --dest-dir=../target/deploy/docs/
45
46    - name: Check for broken links (in HTML)
47      uses: lycheeverse/lychee-action@82202e5e9c2f4ef1a55a3d02563e1cb6041e5332 # v2.4.1
48      with:
49        args: --no-progress --exclude '^http' 'target/deploy/docs/'
50        fail: true