Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 10 additions & 19 deletions .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ permissions:
id-token: write

env:
MDBOOK_LINKCHECK_VER: 0.7.7
MDBOOK_VERSION: 0.5.2
MDBOOK_LINKCHECK2_VERSION: 0.12.2

jobs:
# Fork may have GitHub Pages disabled, so deploying would result in 404
Expand All @@ -29,40 +30,30 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: dtolnay/rust-toolchain@stable
- name: Checkout gb-asm-tutorial
uses: actions/checkout@v2
with:
path: gb-asm-tutorial

- name: Install mdbook
uses: peaceiris/actions-mdbook@v1
- name: Install mdbook and mdbook-linkcheck2
uses: taiki-e/install-action@v2
with:
mdbook-version: 0.4.52
tool: mdbook@${{ env.MDBOOK_VERSION }},mdbook-linkcheck2@${{ env.MDBOOK_LINKCHECK2_VERSION }}

- name: Install static-sitemap-cli
run: npm install static-sitemap-cli

# FIXME: Keep this up to date
- name: Install mdbook-linkcheck
run: | # `-L` because GitHub performs a redirection
curl -L -o mdbook-linkcheck.zip "https://github.com/Michael-F-Bryan/mdbook-linkcheck/releases/download/v$MDBOOK_LINKCHECK_VER/mdbook-linkcheck.x86_64-unknown-linux-gnu.zip"
unzip mdbook-linkcheck.zip mdbook-linkcheck
chmod +x mdbook-linkcheck

- name: Cache build dir
uses: actions/cache@v4
- name: Cache Rust build dir
uses: Swatinem/rust-cache@v2
with:
path: gb-asm-tutorial/target/
key: ${{ runner.os }}-build-${{ hashFiles('gb-asm-tutorial/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-build-
workspaces: gb-asm-tutorial/

- name: Build
working-directory: gb-asm-tutorial/
env:
MDBOOK_BUILD__CREATE_MISSING: "false" # Prevent creating missing files in SUMMARY.md
MDBOOK_OUTPUT__LINKCHECK__COMMAND: "../mdbook-linkcheck"
MDBOOK_OUTPUT__LINKCHECK__OPTIONAL: "false"
MDBOOK_OUTPUT__LINKCHECK2__OPTIONAL: "false"
run: |
mdbook build
for f in po/*.po; do
Expand Down
Loading
Loading