Skip to content

Commit

Permalink
include lychee to check for broken links
Browse files Browse the repository at this point in the history
  • Loading branch information
mxmehl committed Sep 18, 2024
1 parent a7c6067 commit fdd6405
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
36 changes: 35 additions & 1 deletion .github/workflows/hugo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,32 @@ jobs:
run: hugo

- name: Upload artifact
uses: actions/upload-pages-artifact@v2
uses: actions/upload-artifact@v4
with:
name: public
path: ./public
include-hidden-files: true
retention-days: 1

# Checking links using lychee
linkchecker:
runs-on: ubuntu-22.04
needs: build
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: public
path: .

- name: Link Checker
id: lychee
uses: lycheeverse/lychee-action@v1
with:
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 .'
# Fail on errors
fail: false
# TODO: Implement https://github.com/lycheeverse/lychee/issues/989 once it's done. Will help with LinkedIn rate limits

# Deployment job
deploy:
Expand All @@ -56,6 +79,17 @@ jobs:
# Only deploy if on main branch
if: github.ref == 'refs/heads/main'
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: public
path: ./public

- name: Upload pages artifact
uses: actions/upload-pages-artifact@v2
with:
path: ./public

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,7 @@ hugo.linux
# Temporary lock file while building
/.hugo_build.lock

# lychee
.lycheecache

# End of https://www.toptal.com/developers/gitignore/api/hugo

0 comments on commit fdd6405

Please sign in to comment.