External Link Check #30
This file contains 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: External Link Check | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 0 * * MON" | |
jobs: | |
external-link-check: | |
name: External Link Check | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout-repository | |
uses: actions/checkout@v3 | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip setuptools wheel | |
pip install -r ./book/website/requirements.txt | |
- name: Build Jupyter-Book | |
run: | | |
cd ./book/website | |
jupyter-book build . | |
- name: Restore lychee cache | |
uses: actions/cache@v3 | |
with: | |
path: .lycheecache | |
key: cache-lychee-${{ github.sha }} # save cache using commit sha | |
restore-keys: cache-lychee- # restore latest cache (not a specific commit) | |
- name: Check links | |
uses: lycheeverse/lychee-action@v1.8.0 | |
with: | |
args: --config './lychee.toml' --no-progress 'book/website/_build/html/**/*.html' | |
env: | |
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} # Use runner's GitHub token to avoid rate limiting | |
- name: Concatenate Lychee output with issue header | |
run: | | |
cat .github/workflows/resources/external_link_check_header.md lychee/out.md > issue_text.md | |
- name: Update Issue | |
uses: peter-evans/create-issue-from-file@v4 | |
with: | |
title: Broken links | |
issue-number: 3171 | |
content-filepath: issue_text.md | |
token: ${{secrets.GITHUB_TOKEN}} | |
labels: | | |
infrastructure | |
caretaking |