Skip to content

link-checker

link-checker #401

Workflow file for this run

name: link-checker
on:
pull_request:
workflow_dispatch:
schedule:
- cron: '30 0 * * SUN' # Sunday “At 00:30”
jobs:
link-checker:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
if: github.repository == 'brian-rose/ClimateLaboratoryBook'
steps:
- name: Cancel previous runs
uses: styfle/cancel-workflow-action@0.12.1
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v4
- name: Setup Mambaforge
uses: conda-incubator/setup-miniconda@v3
with:
miniforge-variant: Mambaforge
miniforge-version: latest
activate-environment: book-render
use-mamba: true
- name: Set cache date
run: echo "DATE=$(date +'%Y%m%d')" >> $GITHUB_ENV
- uses: actions/cache@v4
with:
path: /usr/share/miniconda3/envs/book-render
key: linux-64-conda-${{ hashFiles('render-environment.yml') }}-${{ env.DATE }}-${{ env.CACHE_NUMBER }}
id: cache
- name: Update environment
if: steps.cache.outputs.cache-hit != 'true'
run: mamba env update -n book-render -f render-environment.yml
# - name: Disable notebook execution
# shell: python
# run: |
# import yaml
# with open('_config.yml') as f:
# data = yaml.safe_load(f)
# data['execute']['execute_notebooks'] = 'off'
# with open('_config.yml', 'w') as f:
# yaml.dump(data, f)
- name: Check external links
run: |
jupyter-book build --builder linkcheck .