Mkdocs : utilise un hook de configuration plutôt que des scripts externes (1/2) #36
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: "🎳 Vérification des liens" | |
| on: | |
| schedule: | |
| - cron: "0 18 5 */3 *" # tous les trois mois, le 5 du mois à 18h | |
| pull_request: | |
| branches: [master] | |
| paths: | |
| - ".github/workflows/links_checker.yml" | |
| workflow_dispatch: | |
| jobs: | |
| linkchecker: | |
| name: "🔗 Check la validité des liens du site" | |
| runs-on: ubuntu-latest | |
| if: ${{ github.repository_owner == 'geotribu' }} | |
| steps: | |
| - name: Get source code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.11 | |
| cache: "pip" | |
| - name: Install dependencies | |
| env: | |
| GH_TOKEN_MATERIAL_INSIDERS: ${{ secrets.GH_TOKEN_MATERIAL_INSIDERS }} | |
| run: | | |
| python -m pip install --upgrade pip setuptools wheel | |
| python -m pip install --upgrade -r requirements-insiders.txt | |
| python -m pip install --upgrade "LinkChecker>=10,<11" | |
| - name: Build static website | |
| run: | | |
| python scripts/100_mkdocs_config_merger.py -c mkdocs.yml | |
| mkdocs build --clean --config-file mkdocs.yml --quiet --strict | |
| env: | |
| MKDOCS_ENABLE_PLUGIN_RSS: true | |
| - name: Run linkcheckr | |
| run: | | |
| linkchecker build/mkdocs/site/ \ | |
| --config .linkcheckrrc \ | |
| --no-warnings \ | |
| --output html \ | |
| --threads 100 \ | |
| > linkchecker_report.html | |
| - name: Save report output as artifact | |
| uses: actions/upload-artifact@v4 | |
| if: ${{ always() }} | |
| continue-on-error: true | |
| with: | |
| path: linkchecker_report.html | |
| retention-days: 30 |