documentation.yml 1.5 KB

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