Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add link checker #85

Merged
merged 3 commits into from
Dec 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/link-checker.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Check Links
on:
pull_request: {}


jobs:
build-and-test-links:
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
# If your Hugo theme is a submodule, this ensures it gets pulled
submodules: true

- name: Read hugo version
id: hugo-version
run: |
HUGO_VERSION=$(grep 'HUGO_VERSION' netlify.toml | sed -E 's/.*=\s*"([^"]+)".*/\1/')
echo ${HUGO_VERSION}
echo "HUGO_VERSION=${HUGO_VERSION}" >> "${GITHUB_OUTPUT}"

- name: Setup Hugo
uses: peaceiris/actions-hugo@v3
with:
hugo-version: '${{ steps.hugo-version.outputs.HUGO_VERSION }}'

- name: Build site
run: hugo

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.3.6'
- name: Create Gemfile and install dependencies
run: |
echo "source 'https://rubygems.org'" > Gemfile
echo "gem 'html-proofer', '5.0.9'" >> Gemfile
bundle install

- name: Run html-proofer
run: htmlproofer ./public --disable-external --no-enforce-https
Loading