Skip to content

Commit 8ae2a49

Browse files
authored
Merge pull request #1613 from mathbunnyru/asalikhov/check_ci_links
Check docs links in Github Actions
2 parents cf1cc03 + 9f7e19e commit 8ae2a49

File tree

3 files changed

+21
-3
lines changed

3 files changed

+21
-3
lines changed

.github/workflows/sphinx.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
name: Build Sphinx Documentation
1+
name: Build Sphinx Documentation and check links
22

33
on:
4+
schedule:
5+
# Weekly, at 03:00 on Monday UTC time
6+
- cron: "0 3 * * 1"
47
pull_request:
58
paths:
69
- ".github/workflows/sphinx.yml"
@@ -43,3 +46,6 @@ jobs:
4346
4447
- name: Build Documentation
4548
run: make docs
49+
50+
- name: Check Documentation URLs
51+
run: make linkcheck-docs

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,10 @@ install-dev-env: ## install libraries required to build images and run tests
138138

139139

140140
docs: ## build HTML documentation
141-
sphinx-build -W docs/ docs/_build/
141+
sphinx-build -W --keep-going --color docs/ docs/_build/
142142

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

146146
install-docs-env: ## install libraries required to build docs
147147
@pip install -r requirements-docs.txt

docs/conf.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,3 +88,15 @@
8888

8989
# MyST configuration reference: https://myst-parser.readthedocs.io/en/latest/sphinx/reference.html
9090
myst_heading_anchors = 3
91+
92+
linkcheck_ignore = [
93+
r".*github\.com.*#", # javascript based anchors
94+
r"http://127\.0\.0\.1:49153/.*", # example
95+
r"https://mybinder\.org/v2/gh/.*", # lots of 500 errors
96+
]
97+
98+
linkcheck_allowed_redirects = {
99+
r"https://results\.pre-commit\.ci/latest/github/jupyter/docker-stacks/master": r"https://results\.pre-commit\.ci/run/github/.*", # Latest master CI build
100+
r"https://github\.com/jupyter/docker-stacks/issues/new.*": r"https://github\.com/login.*", # Github wants user to be logon to use this features
101+
r"https://github\.com/orgs/jupyter/teams/docker-image-maintainers/members": r"https://github\.com/login.*",
102+
}

0 commit comments

Comments
 (0)