From 343b78e347e9545828a4090b5605e2c0c48601a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A9r=C3=A9nice=20Batut?= Date: Wed, 4 Dec 2024 11:54:28 +0100 Subject: [PATCH] Add GitHub workflow to check internal links --- .../{jekyll.yml => deploy_jekyll.yml} | 0 .github/workflows/lint_jekyll.yaml | 44 +++++++++++++++++++ 2 files changed, 44 insertions(+) rename .github/workflows/{jekyll.yml => deploy_jekyll.yml} (100%) create mode 100644 .github/workflows/lint_jekyll.yaml diff --git a/.github/workflows/jekyll.yml b/.github/workflows/deploy_jekyll.yml similarity index 100% rename from .github/workflows/jekyll.yml rename to .github/workflows/deploy_jekyll.yml diff --git a/.github/workflows/lint_jekyll.yaml b/.github/workflows/lint_jekyll.yaml new file mode 100644 index 00000000..07f3010f --- /dev/null +++ b/.github/workflows/lint_jekyll.yaml @@ -0,0 +1,44 @@ +name: Lint Jekyll site + +on: [push, pull_request] + +jobs: + check-internal-links: + runs-on: ubuntu-latest + defaults: + run: + working-directory: docs + steps: + - uses: actions/checkout@v3 + - uses: ruby/setup-ruby@v1.196.0 + with: + ruby-version: '3.3' + bundler-cache: true + cache-version: 0 + - name: Setup Pages + id: pages + uses: actions/configure-pages@v3 + - name: Install dependencies + run: | + bundle install + - name: Build with Jekyll + # Outputs to the './_site' directory by default + run: | + bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}" + env: + JEKYLL_ENV: production + PAGES_REPO_NWO: ${{ github.repository }} + JEKYLL_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + JEKYLL_BUILD_BRANCH: ${{ github.ref_name }} + JEKYLL_BASE_PATH: ${{ steps.pages.outputs.base_path }} + - name: Validate HTML and check links + run: | + bundle exec htmlproofer \ + --allow_missing_href=true \ + --ignore-urls "/.*localhost.*/","/.*gitter\.im.*/" \ + --enforce-https=false \ + --disable-external=true \ + --ignore_empty_alt=true \ + --ignore_missing_alt=true \ + --check-internal-hash=false \ + ./_site \ No newline at end of file