Skip to content

Commit 201440e

Browse files
committed
Try link checking of just the source files without building the Hugo page
1 parent 056c10a commit 201440e

File tree

1 file changed

+4
-34
lines changed

1 file changed

+4
-34
lines changed

.github/workflows/link-check.yml

Lines changed: 4 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# Workflow for building and link checking a Hugo site on PRs
2-
name: Build and Link Check Hugo site on PRs
1+
# Workflow for link checking with lychee
2+
name: Link Check Source Files with Lychee
33

44
on:
55
# Runs on pull requests targeting the dev branch
@@ -8,45 +8,15 @@ on:
88
# Allows you to run this workflow manually from the Actions tab
99
workflow_dispatch:
1010

11-
# Default to bash
12-
defaults:
13-
run:
14-
shell: bash
15-
1611
jobs:
17-
# Build and Link Check job
18-
build_and_link_check:
12+
link_check:
1913
runs-on: ubuntu-latest
20-
env:
21-
HUGO_VERSION: 0.128.0
2214
steps:
23-
- name: Install Hugo CLI
24-
run: |
25-
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \
26-
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb
27-
28-
- name: Install Dart Sass
29-
run: sudo snap install dart-sass
30-
3115
- name: Checkout
3216
uses: actions/checkout@v4
33-
with:
34-
submodules: recursive
35-
36-
- name: Install Node.js dependencies
37-
run: "[[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true"
38-
39-
- name: Build with Hugo
40-
env:
41-
HUGO_CACHEDIR: ${{ runner.temp }}/hugo_cache
42-
HUGO_ENVIRONMENT: production
43-
run: hugo --minify
44-
45-
- name: List files in the public directory with the HUGO build
46-
run: ls -R public
4717

4818
- name: Link Checker
4919
id: lychee
5020
uses: lycheeverse/lychee-action@v2
5121
with:
52-
args: --verbose --no-progress --exclude "https://neurodatawithoutborders.github.io/" 'public/**/*.html'
22+
args: --verbose --no-progress --exclude "https://example.com" './**/*.md' './**/*.html' './**/*.rst'

0 commit comments

Comments
 (0)