Skip to content

Commit 060dc54

Browse files
committed
Update mdbook-linkcheck
1 parent c0865bf commit 060dc54

File tree

2 files changed

+49
-52
lines changed

2 files changed

+49
-52
lines changed

.github/workflows/build-and-deploy.yml

Lines changed: 49 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,71 @@
11
name: Build and deploy an updated version of the website
22

3-
on:
4-
[push, pull_request]
3+
on: [push, pull_request]
54

65
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
76
permissions:
87
contents: read
98
pages: write
109
id-token: write
11-
10+
1211
env:
13-
MDBOOK_LINKCHECK_VER: 0.7.4
12+
MDBOOK_LINKCHECK_VER: 0.7.7
1413

1514
jobs:
1615
build:
1716
runs-on: ubuntu-latest
1817
steps:
19-
- name: Checkout gb-asm-tutorial
20-
uses: actions/checkout@v2
21-
with:
22-
path: gb-asm-tutorial
18+
- name: Checkout gb-asm-tutorial
19+
uses: actions/checkout@v2
20+
with:
21+
path: gb-asm-tutorial
22+
23+
- name: Install mdbook
24+
uses: peaceiris/actions-mdbook@v1
25+
with:
26+
mdbook-version: latest
27+
28+
- name: Install static-sitemap-cli
29+
run: npm install static-sitemap-cli
2330

24-
- name: Install mdbook
25-
uses: peaceiris/actions-mdbook@v1
26-
with:
27-
mdbook-version: latest
28-
29-
- name: Install static-sitemap-cli
30-
run: npm install static-sitemap-cli
31+
# FIXME: Keep this up to date
32+
- name: Install mdbook-linkcheck
33+
run: | # `-L` because GitHub performs a redirection
34+
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"
35+
unzip mdbook-linkcheck.zip mdbook-linkcheck
36+
chmod +x mdbook-linkcheck
3137
32-
# FIXME: Keep this up to date
33-
- name: Install mdbook-linkcheck
34-
run: | # `-L` because GitHub performs a redirection
35-
curl -L -o mdbook-linkcheck.zip "https://github.com/Michael-F-Bryan/mdbook-linkcheck/releases/download/v$MDBOOK_LINKCHECK_VER/mdbook-linkcheck.v$MDBOOK_LINKCHECK_VER.x86_64-unknown-linux-gnu.zip"
36-
unzip mdbook-linkcheck.zip mdbook-linkcheck
37-
chmod +x mdbook-linkcheck
38+
- name: Cache build dir
39+
uses: actions/cache@v4
40+
with:
41+
path: gb-asm-tutorial/target/
42+
key: ${{ runner.os }}-build-${{ hashFiles('gb-asm-tutorial/Cargo.lock') }}
43+
restore-keys: |
44+
${{ runner.os }}-build-
3845
39-
- name: Cache build dir
40-
uses: actions/cache@v4
41-
with:
42-
path: gb-asm-tutorial/target/
43-
key: ${{ runner.os }}-build-${{ hashFiles('gb-asm-tutorial/Cargo.lock') }}
44-
restore-keys: |
45-
${{ runner.os }}-build-
46+
- name: Build
47+
working-directory: gb-asm-tutorial/
48+
env:
49+
MDBOOK_BUILD__CREATE_MISSING: "false" # Prevent creating missing files in SUMMARY.md
50+
MDBOOK_OUTPUT__LINKCHECK__COMMAND: "../mdbook-linkcheck"
51+
MDBOOK_OUTPUT__LINKCHECK__OPTIONAL: "false"
52+
run: |
53+
mdbook build
54+
for f in po/*.po; do
55+
lang=$(basename -s .po "$f")
56+
MDBOOK_BOOK__LANGUAGE="$lang" mdbook build -d book/"$lang"
57+
mv book/"$lang"/custom book/custom/"$lang"
58+
done
4659
47-
- name: Build
48-
working-directory: gb-asm-tutorial/
49-
env:
50-
MDBOOK_BUILD__CREATE_MISSING: "false" # Prevent creating missing files in SUMMARY.md
51-
MDBOOK_OUTPUT__LINKCHECK__COMMAND: "../mdbook-linkcheck"
52-
MDBOOK_OUTPUT__LINKCHECK__OPTIONAL: "false"
53-
run: |
54-
mdbook build
55-
for f in po/*.po; do
56-
lang=$(basename -s .po "$f")
57-
MDBOOK_BOOK__LANGUAGE="$lang" mdbook build -d book/"$lang"
58-
mv book/"$lang"/custom book/custom/"$lang"
59-
done
60+
- name: Generate sitemap
61+
run: |
62+
cd gb-asm-tutorial/book/custom/
63+
npx sscli --no-clean --base https://gbdev.io/gb-asm-tutorial
6064
61-
- name: Generate sitemap
62-
run: |
63-
cd gb-asm-tutorial/book/custom/
64-
npx sscli --no-clean --base https://gbdev.io/gb-asm-tutorial
65-
66-
- name: Store final build
67-
uses: actions/upload-pages-artifact@v3
68-
with:
69-
path: gb-asm-tutorial/book/custom/
65+
- name: Store final build
66+
uses: actions/upload-pages-artifact@v3
67+
with:
68+
path: gb-asm-tutorial/book/custom/
7069

7170
deploy:
7271
name: Deploy to GitHub pages

book.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ command = "cargo run -p renderer --locked -rq --"
2626
[output.html]
2727
additional-css = ["css/custom.css"]
2828
additional-js = ["js/linenos.js"]
29-
# rgbasm.min.js gets injected into highlight.js by the renderer
3029
smart-punctuation = true
3130
print = { enable = true }
3231
fold = { enable = true, level = 0 }
@@ -35,5 +34,4 @@ edit-url-template = "https://github.com/gbdev/gb-asm-tutorial/edit/master/{path}
3534
site-url = "/gb-asm-tutorial/"
3635

3736
[output.linkcheck]
38-
traverse-parent-directories = true # We intentionally read some files outside of `src/`
3937
optional = true

0 commit comments

Comments
 (0)