Skip to content

Commit fdd6405

Browse files
committed
include lychee to check for broken links
1 parent a7c6067 commit fdd6405

File tree

2 files changed

+38
-1
lines changed

2 files changed

+38
-1
lines changed

.github/workflows/hugo.yaml

+35-1
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,32 @@ jobs:
4242
run: hugo
4343

4444
- name: Upload artifact
45-
uses: actions/upload-pages-artifact@v2
45+
uses: actions/upload-artifact@v4
4646
with:
47+
name: public
4748
path: ./public
49+
include-hidden-files: true
50+
retention-days: 1
51+
52+
# Checking links using lychee
53+
linkchecker:
54+
runs-on: ubuntu-22.04
55+
needs: build
56+
steps:
57+
- name: Download artifact
58+
uses: actions/download-artifact@v4
59+
with:
60+
name: public
61+
path: .
62+
63+
- name: Link Checker
64+
id: lychee
65+
uses: lycheeverse/lychee-action@v1
66+
with:
67+
args: '-r 5 -u "Mozilla/5.0 (Windows NT 10.0; Win64; x64) Apple WebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36" --exclude sncf.com --exclude nge.flatland.cloud --max-concurrency 1 .'
68+
# Fail on errors
69+
fail: false
70+
# TODO: Implement https://github.com/lycheeverse/lychee/issues/989 once it's done. Will help with LinkedIn rate limits
4871

4972
# Deployment job
5073
deploy:
@@ -56,6 +79,17 @@ jobs:
5679
# Only deploy if on main branch
5780
if: github.ref == 'refs/heads/main'
5881
steps:
82+
- name: Download artifact
83+
uses: actions/download-artifact@v4
84+
with:
85+
name: public
86+
path: ./public
87+
88+
- name: Upload pages artifact
89+
uses: actions/upload-pages-artifact@v2
90+
with:
91+
path: ./public
92+
5993
- name: Deploy to GitHub Pages
6094
id: deployment
6195
uses: actions/deploy-pages@v2

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,7 @@ hugo.linux
1616
# Temporary lock file while building
1717
/.hugo_build.lock
1818

19+
# lychee
20+
.lycheecache
21+
1922
# End of https://www.toptal.com/developers/gitignore/api/hugo

0 commit comments

Comments
 (0)