build-docs.yaml 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. name: build-docs
  2. on:
  3. push:
  4. branches:
  5. - main
  6. - "build-docs-*"
  7. pull_request:
  8. branches:
  9. - main
  10. permissions:
  11. contents: write
  12. jobs:
  13. deploy:
  14. runs-on: ubuntu-latest
  15. steps:
  16. - uses: actions/checkout@v4
  17. with:
  18. fetch-depth: 0
  19. - name: Configure Git Credentials
  20. run: |
  21. git config user.name github-actions[bot]
  22. git config user.email 41898282+github-actions[bot]@users.noreply.github.com
  23. - uses: actions/setup-python@v5
  24. with:
  25. python-version: 3.x
  26. - run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
  27. - uses: actions/cache@v4
  28. with:
  29. key: mkdocs-material-${{ env.cache_id }}
  30. path: .cache
  31. restore-keys: |
  32. mkdocs-material-
  33. - name: Install uv
  34. run: |
  35. curl -LsSf https://astral.sh/uv/install.sh | sh
  36. - run: uv pip install --python ${Python_ROOT_DIR} '.[dev]'
  37. - name: Build Documentation
  38. if: github.ref != 'refs/heads/main'
  39. run: mkdocs build
  40. - name: Build + Deploy Documentation
  41. if: github.ref == 'refs/heads/main'
  42. run: mkdocs gh-deploy --force