Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check docs links in Github Actions #1613

Merged
merged 2 commits into from
Feb 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .github/workflows/sphinx.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Build Sphinx Documentation
name: Build Sphinx Documentation and check links

on:
schedule:
# Weekly, at 03:00 on Monday UTC time
- cron: "0 3 * * 1"
pull_request:
paths:
- ".github/workflows/sphinx.yml"
Expand Down Expand Up @@ -43,3 +46,6 @@ jobs:

- name: Build Documentation
run: make docs

- name: Check Documentation URLs
run: make linkcheck-docs
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,10 @@ install-dev-env: ## install libraries required to build images and run tests


docs: ## build HTML documentation
sphinx-build -W docs/ docs/_build/
sphinx-build -W --keep-going --color docs/ docs/_build/

linkcheck-docs: ## check broken links
sphinx-build -b linkcheck docs/ docs/_build/
sphinx-build -W --keep-going --color -b linkcheck docs/ docs/_build/

install-docs-env: ## install libraries required to build docs
@pip install -r requirements-docs.txt
Expand Down
12 changes: 12 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,15 @@

# MyST configuration reference: https://myst-parser.readthedocs.io/en/latest/sphinx/reference.html
myst_heading_anchors = 3

linkcheck_ignore = [
r".*github\.com.*#", # javascript based anchors
r"http://127\.0\.0\.1:49153/.*", # example
r"https://mybinder\.org/v2/gh/.*", # lots of 500 errors
]

linkcheck_allowed_redirects = {
r"https://results\.pre-commit\.ci/latest/github/jupyter/docker-stacks/master": r"https://results\.pre-commit\.ci/run/github/.*", # Latest master CI build
r"https://github\.com/jupyter/docker-stacks/issues/new.*": r"https://github\.com/login.*", # Github wants user to be logon to use this features
r"https://github\.com/orgs/jupyter/teams/docker-image-maintainers/members": r"https://github\.com/login.*",
}