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: Download WASI SDK
23      shell: bash -euxo pipefail {0}
24      run: ./script/download-wasi-sdk
25
26    - name: Generate action metadata
27      shell: bash -euxo pipefail {0}
28      run: ./script/generate-action-metadata
29
30    - name: Check for broken links (in MD)
31      uses: lycheeverse/lychee-action@82202e5e9c2f4ef1a55a3d02563e1cb6041e5332 # v2.4.1
32      with:
33        args: --no-progress --exclude '^http' './docs/src/**/*'
34        fail: true
35
36    - name: Build book
37      shell: bash -euxo pipefail {0}
38      run: |
39        mkdir -p target/deploy
40        mdbook build ./docs --dest-dir=../target/deploy/docs/
41
42    - name: Check for broken links (in HTML)
43      uses: lycheeverse/lychee-action@82202e5e9c2f4ef1a55a3d02563e1cb6041e5332 # v2.4.1
44      with:
45        args: --no-progress --exclude '^http' 'target/deploy/docs/'
46        fail: true