diff --git a/.github/workflows/check-links.yaml b/.github/workflows/check-links.yaml new file mode 100644 index 000000000..acdc2d2d1 --- /dev/null +++ b/.github/workflows/check-links.yaml @@ -0,0 +1,56 @@ +name: docs + +on: + pull_request: + push: + branches: + - master + +jobs: + markdown-link-checker: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install markdown-link-check + run: | + npm i markdown-link-check + + - name: Check non-user-guide markdown docs + run: | + find . \ + -name vendor -prune -o \ + -name node_modules -prune -o \ + -name docs -prune -o \ + -iname '*.md' \ + -exec ./node_modules/markdown-link-check/markdown-link-check -q --config .github/workflows/markdown-link-check-config.json {} + + + site-link-checker: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [3.8] + steps: + - uses: actions/checkout@v2 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v1 + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r docs/requirements.txt + + - name: Build docs for link check + run: mkdocs build + + # Using liche action to check generated HTML site + - name: Link Checker (generated site) + id: lc2 + uses: peter-evans/link-checker@v1 + with: + args: -d site/ -r site/ -x 'github.com/weaveworks/ignite($|/issue|/pull)' -c 10 + + - name: Fail if there were link errors + run: exit ${{ steps.lc2.outputs.exit_code }} diff --git a/.github/workflows/markdown-link-check-config.json b/.github/workflows/markdown-link-check-config.json new file mode 100644 index 000000000..813ca2044 --- /dev/null +++ b/.github/workflows/markdown-link-check-config.json @@ -0,0 +1,6 @@ +{ + "ignorePatterns": [ + { "pattern": "^https://github.com/\\S+/\\S+/(issues|pull)/" }, + { "pattern": "^mailto:" } + ] +} diff --git a/docs/requirements.txt b/docs/requirements.txt index 3ea9b3597..4cb5af659 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,3 +1,3 @@ -mkdocs == 1.1 -mkdocs-material == 5.0.1 -pymdown-extensions >= 7.0.0 +mkdocs == 1.1.2 +mkdocs-material == 5.2.2 +pymdown-extensions >= 7.1 diff --git a/mkdocs.yml b/mkdocs.yml index 1994d2c00..a3d4b6e79 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -28,6 +28,6 @@ markdown_extensions: - admonition - codehilite: guess_lang: false - - pymdownx.superfences + - pymdownx.tabbed - toc: permalink: true