generated from ProjectPythia/cookbook-template
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #41 from jukent/rename
attempt to fix link checker
- Loading branch information
Showing
2 changed files
with
41 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
jobs: | ||
link-checker: | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Setup Mambaforge | ||
uses: conda-incubator/setup-miniconda@v3 | ||
with: | ||
miniforge-variant: Mambaforge | ||
miniforge-version: latest | ||
use-mamba: true | ||
|
||
- name: Install Jupyterbook | ||
run: mamba install -c conda-forge jupyter-book | ||
|
||
- name: Check for config file | ||
id: check_config | ||
uses: andstor/file-existence-action@v2 | ||
with: | ||
files: "${{ inputs.path_to_notebooks }}/_config.yml" | ||
|
||
- name: Disable notebook execution | ||
if: steps.check_config.outputs.files_exists == 'true' | ||
shell: python | ||
run: | | ||
import yaml | ||
with open('${{ inputs.path_to_notebooks }}/_config.yml') as f: | ||
data = yaml.safe_load(f) | ||
data['execute']['execute_notebooks'] = 'off' | ||
with open('${{ inputs.path_to_notebooks }}/_config.yml', 'w') as f: | ||
yaml.dump(data, f) | ||
- name: Check external links | ||
run: | | ||
cd ${{ inputs.path_to_notebooks }} | ||
linkchecker --ignore-url "https://www.noaa.gov/jetstream" --ignore-url "https://weather.uwyo.edu/upperair/" --ignore-ssl-check ${{ inputs.build_command }} |
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