docs.yml 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. name: Deploy Documentation
  2. on:
  3. push:
  4. branches:
  5. - main
  6. paths:
  7. - 'docs/**'
  8. - 'mkdocs.yml'
  9. - '.github/workflows/docs.yml'
  10. workflow_dispatch: # Allow manual trigger
  11. permissions:
  12. contents: write
  13. jobs:
  14. deploy:
  15. runs-on: ubuntu-latest
  16. steps:
  17. - name: Checkout code
  18. uses: actions/checkout@v4
  19. with:
  20. fetch-depth: 0 # Fetch all history for git-revision-date-localized plugin
  21. - name: Setup Python
  22. uses: actions/setup-python@v5
  23. with:
  24. python-version: '3.12'
  25. - name: Cache dependencies
  26. uses: actions/cache@v4
  27. with:
  28. path: ~/.cache/pip
  29. key: ${{ runner.os }}-pip-${{ hashFiles('requirements-docs.txt') }}
  30. restore-keys: |
  31. ${{ runner.os }}-pip-
  32. - name: Install dependencies
  33. run: |
  34. pip install --upgrade pip
  35. pip install -r requirements-docs.txt
  36. - name: Build and deploy documentation
  37. run: mkdocs gh-deploy --force