Skip to content

Commit 21246b0

Browse files
committed
Move link check to a job dependent on build
1 parent 9a7f203 commit 21246b0

File tree

2 files changed

+30
-21
lines changed

2 files changed

+30
-21
lines changed

.github/workflows/build-website.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,33 @@ jobs:
2121
- name: Build website
2222
run: |
2323
npm run build
24+
- name: Upload html output as artifact
25+
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
26+
with:
27+
name: html-${{ github.run_id }}
28+
path: ./dist
29+
link_check:
30+
runs-on: ubuntu-latest
31+
needs: build
32+
steps:
33+
- name: Checkout lychee config file from repository
34+
uses: actions/checkout@v5
35+
with:
36+
sparse-checkout: |
37+
lychee.toml
38+
sparse-checkout-cone-mode: false
39+
- name: Ensure destination folder exists
40+
run: |
41+
mkdir ./dist
42+
- name: Download html files from artifact
43+
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
44+
with:
45+
name: book-html-${{ github.run_id }}
46+
path: ./dist
47+
- name: Offline link check
48+
uses: lycheeverse/lychee-action@v2
49+
with:
50+
# Only check local files, no network requests
51+
args: --config './lychee.toml' --no-progress --offline --root-dir "$GITHUB_WORKSPACE/dist/" dist/**/*.html
52+
# Fail job when lychee returns a non-zero exit code
53+
fail: true

.github/workflows/offline-link-check.yml

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)