Added link checker #29
Workflow file for this run
This file contains hidden or 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
| name: "Check documentation links" | |
| on: | |
| push: | |
| branches: | |
| - master | |
| - "[0-9]+.[0-9]+" | |
| workflow_dispatch: | |
| inputs: | |
| force_recheck: | |
| description: "Clear lychee cache and recheck all links from scratch" | |
| type: boolean | |
| default: false | |
| devdoc_50_branch: | |
| description: "ibexa/documentation-developer branch for 5.0" | |
| type: string | |
| default: "5.0" | |
| devdoc_46_branch: | |
| description: "ibexa/documentation-developer branch for 4.6" | |
| type: string | |
| default: "4.6" | |
| userdoc_50_branch: | |
| description: "ibexa/documentation-user branch for 5.0" | |
| type: string | |
| default: "5.0" | |
| userdoc_46_branch: | |
| description: "ibexa/documentation-user branch for 4.6" | |
| type: string | |
| default: "4.6" | |
| connect_branch: | |
| description: "ibexa/documentation-connect branch" | |
| type: string | |
| default: "main" | |
| pull_request: ~ | |
| schedule: | |
| - cron: "0 6 * * *" | |
| jobs: | |
| link-check: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: [3.13] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Generate token | |
| id: generate_token | |
| uses: actions/create-github-app-token@v2 | |
| with: | |
| app-id: ${{ secrets.AUTOMATION_CLIENT_ID }} | |
| private-key: ${{ secrets.AUTOMATION_CLIENT_SECRET }} | |
| owner: ${{ github.repository_owner }} | |
| - name: Configure git credentials for private repositories | |
| run: | | |
| git config --global url."https://x-access-token:${{ steps.generate_token.outputs.token }}@github.com/ibexa/documentation-connect".insteadOf \ | |
| "https://github.com/ibexa/documentation-connect" | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install MkDocs dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| - name: Build documentation | |
| run: mkdocs build --strict | |
| - name: Clone and build versioned repositories for link remap | |
| run: >- | |
| bash tools/clone-repositories.sh | |
| "${{ inputs.devdoc_50_branch || '5.0' }}" | |
| "${{ inputs.devdoc_46_branch || '4.6' }}" | |
| "${{ inputs.userdoc_50_branch || '5.0' }}" | |
| "${{ inputs.userdoc_46_branch || '4.6' }}" | |
| "${{ inputs.connect_branch || 'main' }}" | |
| - name: Restore lychee cache | |
| if: ${{ !inputs.force_recheck }} | |
| uses: actions/cache@v4 | |
| with: | |
| path: .lycheecache | |
| key: lychee-${{ github.ref_name }}-${{ hashFiles('lychee.toml') }} | |
| restore-keys: | | |
| lychee-${{ github.ref_name }}- | |
| lychee- | |
| - name: Check links | |
| uses: lycheeverse/lychee-action@v2 | |
| with: | |
| lycheeVersion: v0.24.2 | |
| args: >- | |
| --config lychee.toml | |
| --cache | |
| --cache-exclude-status "400.." | |
| site | |
| output: lychee-report.md | |
| jobSummary: false | |
| fail: true | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Upload link-check report | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: lychee-report | |
| path: lychee-report.md | |
| if-no-files-found: ignore |