Skip to content

Commit 4dd33d4

Browse files
committed
Avoid broken links blocking the site's deployment
1 parent bf469a3 commit 4dd33d4

File tree

1 file changed

+38
-8
lines changed

1 file changed

+38
-8
lines changed

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

Lines changed: 38 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,6 @@ jobs:
5454
- name: Install static-sitemap-cli
5555
run: npm install static-sitemap-cli
5656

57-
# FIXME: Keep this up to date
58-
- name: Install mdbook-linkcheck
59-
run: | # `-L` because GitHub performs a redirection
60-
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"
61-
unzip mdbook-linkcheck.zip mdbook-linkcheck
62-
chmod +x mdbook-linkcheck
63-
6457
- name: Install Python dependencies
6558
run: |
6659
python -m pip install --upgrade pip
@@ -70,7 +63,6 @@ jobs:
7063
working-directory: pandocs/
7164
env:
7265
MDBOOK_BUILD__CREATE_MISSING: "false" # Prevent creating missing files in SUMMARY.md
73-
MDBOOK_OUTPUT__LINKCHECK__COMMAND: "../mdbook-linkcheck"
7466
run: |
7567
mdbook build
7668
@@ -84,6 +76,44 @@ jobs:
8476
with:
8577
path: pandocs/docs/pandocs/
8678

79+
linkcheck:
80+
name: Check for dead links
81+
runs-on: ubuntu-latest
82+
steps:
83+
- name: Checkout pandocs
84+
uses: actions/checkout@v4
85+
with:
86+
path: pandocs
87+
88+
- name: Cache Rust build dir
89+
uses: Swatinem/rust-cache@v2
90+
with:
91+
workspaces: pandocs/target/
92+
93+
- name: Install mdbook
94+
uses: peaceiris/actions-mdbook@v2
95+
with:
96+
mdbook-version: 0.4.40
97+
98+
# FIXME: Keep this up to date
99+
- name: Install mdbook-linkcheck
100+
run: | # `-L` because GitHub performs a redirection
101+
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"
102+
unzip mdbook-linkcheck.zip mdbook-linkcheck
103+
chmod +x mdbook-linkcheck
104+
105+
- name: Install Python dependencies
106+
run: |
107+
python -m pip install --upgrade pip
108+
pip install -r pandocs/requirements.txt
109+
110+
- name: Check links
111+
working-directory: pandocs/
112+
env:
113+
MDBOOK_OUTPUT__LINKCHECK__COMMAND: "../mdbook-linkcheck"
114+
run: |
115+
mdbook build
116+
87117
deploy:
88118
name: Deploy to GitHub pages
89119
# Do not run this unless *pushing* to `master`.

0 commit comments

Comments
 (0)