documentation.yml 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. ---
  2. name: Documentation
  3. # yamllint disable-line rule:truthy
  4. on:
  5. workflow_dispatch:
  6. workflow_run:
  7. workflows:
  8. - Integration
  9. types:
  10. - completed
  11. branches:
  12. - master
  13. concurrency:
  14. group: ${{ github.workflow }}-${{ github.ref_name }}
  15. cancel-in-progress: false
  16. permissions:
  17. contents: read
  18. env:
  19. PYTHON_VERSION: "3.13"
  20. jobs:
  21. release:
  22. if: github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success'
  23. name: Release
  24. runs-on: ubuntu-24.04-arm
  25. permissions:
  26. # for JamesIves/github-pages-deploy-action to push
  27. contents: write
  28. steps:
  29. - name: Setup Python
  30. uses: actions/setup-python@v5
  31. with:
  32. python-version: "${{ env.PYTHON_VERSION }}"
  33. - name: Checkout
  34. uses: actions/checkout@v4
  35. with:
  36. persist-credentials: "false"
  37. fetch-depth: "0"
  38. - name: Setup cache Python
  39. uses: actions/cache@v4
  40. with:
  41. key: "python-${{ env.PYTHON_VERSION }}-${{ runner.arch }}-${{ hashFiles('./requirements*.txt') }}"
  42. restore-keys: "python-${{ env.PYTHON_VERSION }}-${{ runner.arch }}-"
  43. path: "./local/"
  44. - name: Setup venv
  45. run: make V=1 install
  46. - name: Build documentation
  47. run: make V=1 docs.clean docs.html
  48. - name: Release
  49. uses: JamesIves/github-pages-deploy-action@v4
  50. with:
  51. folder: "dist/docs"
  52. branch: "gh-pages"
  53. commit-message: "[doc] build from commit ${{ github.sha }}"
  54. # Automatically remove deleted files from the deploy branch
  55. clean: "true"
  56. single-commit: "true"