Files
Ravi Kumar Pilla 5ed3758cc7 Fix broken doc links (#5260)
* fix broken links

* add git action for link check within codebase

* add git action for link check within codebase

* add git action for link check within codebase

* link check for yml

* testing asv benchmark

* testing asv benchmark

* testing asv benchmark

* revert testing asv benchmark

* lychee check in docslink

* lychee test in docslink

* update ignore file

* update ignore file

* final test
2025-12-10 09:24:37 -06:00

72 lines
1.7 KiB
YAML

name: Check links in MkDocs
on:
push:
branches:
- main
- develop
pull_request:
branches:
- main
- develop
jobs:
linkcheck:
permissions:
contents: read
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ "3.11" ]
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install the latest version of uv with Python ${{inputs.python-version}}
uses: astral-sh/setup-uv@v7
with:
version: "latest"
python-version: ${{ inputs.python-version }}
activate-environment: true
- name: Install docs requirements
run: |
make install-docs-requirements
- name: Run MkDocs on strict mode.
run: |
mkdocs build --strict
- name: Serve docs locally in background
run: |
cd site
python -m http.server 8000 &
echo $! > ../docs_server.pid
sleep 5 # Give server time to start
- name: Check docs.kedro.org links in Python files against local build
uses: lycheeverse/lychee-action@v2
with:
args: >
--extensions py,yml
--verbose
--no-progress
--remap "https://docs.kedro.org/en/stable/ http://localhost:8000/"
.
- name: Stop docs server
if: always()
run: |
if [ -f docs_server.pid ]; then
kill $(cat docs_server.pid) || true
rm docs_server.pid
fi