Link Checker #300
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Link Checker | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "00 18 * * *" | |
jobs: | |
linkChecker: | |
if: | | |
github.repository_owner == 'elixir-europe' | |
runs-on: ubuntu-latest | |
permissions: | |
issues: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: '3.1' | |
bundler-cache: true | |
cache-version: 0 | |
- name: Install dependencies | |
run: | | |
bundle install | |
- name: Build with Jekyll | |
# Outputs to the './_site' directory by default | |
run: | | |
bundle exec jekyll build | |
env: | |
PAGES_REPO_NWO: ${{ github.repository }} | |
JEKYLL_BUILD_BRANCH: ${{ github.ref_name }} | |
JEKYLL_ENV: production | |
JEKYLL_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Link Checker | |
id: lychee | |
uses: lycheeverse/lychee-action@v2.1.0 | |
with: | |
# Check all markdown, html and reStructuredText files in repo (default) | |
args: --fallback-extensions html --exclude '^https://github\.com' --root-dir "${{ github.workspace }}/_site" _site/ --exclude-path all_tools_and_resources.html --exclude-path all_training_resources.html | |
# Don't fail action on broken links | |
fail: false | |
lycheeVersion: v0.20.0 | |
- name: Add page URL | |
run: | | |
DEPLOY_URL="https://rdmkit.elixir-europe.org/" && \ | |
sed -i "s|\\#\\#\\# Errors in _site\/|\\#\\#\\# Errors in ${DEPLOY_URL}|g" ./lychee/out.md && \ | |
cat ./lychee/out.md | |
- name: Create Issue From File | |
if: steps.lychee.outputs.exit_code != 0 | |
uses: peter-evans/create-issue-from-file@v5 | |
with: | |
title: Link Checker Report | |
content-filepath: ./lychee/out.md | |
labels: bug, automated issue | |
issue-number: 1570 |