Check markdown links #113
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: Check markdown links | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 0 1 * *' # Every month | |
push: | |
branches: | |
- main | |
paths: | |
- 'docs/**' | |
- '.github/workflows/linkcheck.yml' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
linkcheck: | |
env: | |
DIR: 'docs' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Julia | |
uses: julia-actions/setup-julia@v2 | |
- name: Convert literate notebooks to ipynb files | |
shell: julia --color=yes {0} | |
working-directory: ${{ env.DIR }} | |
run: | | |
import Pkg | |
Pkg.add("Literate") | |
using Literate | |
for (root, dirs, files) in walkdir(pwd()) | |
for file in files | |
if endswith(file, ".jl") | |
nb = joinpath(root, file) | |
Literate.notebook(nb, dirname(nb); mdstrings=true, execute=false) | |
end | |
end | |
end | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
id: setup-python | |
with: | |
python-version: '3.x' | |
- name: Cache python | |
uses: actions/cache@v4 | |
if: ${{ contains(runner.name, 'GitHub Actions') }} | |
id: cache-py | |
with: | |
key: ${{ runner.os }}-pip-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('requirements.txt') }} | |
path: | | |
${{ env.pythonLocation }}/lib | |
${{ env.pythonLocation }}/bin | |
- name: Install Python dependencies | |
if: ${{ !contains(runner.name, 'GitHub Actions') || steps.cache-py.outputs.cache-hit != 'true' }} | |
run: pip install -r requirements.txt | |
- name: Build website | |
run: jupyter-book build ${DIR} --builder linkcheck |