documentation.yml 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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 }}
  14. cancel-in-progress: false
  15. permissions:
  16. contents: read
  17. env:
  18. PYTHON_VERSION: "3.13"
  19. jobs:
  20. release:
  21. if: github.repository_owner == 'searxng' || github.event_name == 'workflow_dispatch'
  22. name: Release
  23. runs-on: ubuntu-24.04-arm
  24. permissions:
  25. # for JamesIves/github-pages-deploy-action to push
  26. contents: write
  27. steps:
  28. - name: Setup Python
  29. uses: actions/setup-python@v5
  30. with:
  31. python-version: "${{ env.PYTHON_VERSION }}"
  32. - name: Checkout
  33. uses: actions/checkout@v4
  34. with:
  35. persist-credentials: "false"
  36. fetch-depth: "0"
  37. - name: Setup cache Python
  38. uses: actions/cache@v4
  39. with:
  40. key: "python-${{ env.PYTHON_VERSION }}-${{ runner.arch }}-${{ hashFiles('./requirements*.txt') }}"
  41. restore-keys: "python-${{ env.PYTHON_VERSION }}-${{ runner.arch }}-"
  42. path: "./local/"
  43. - name: Setup venv
  44. run: make V=1 install
  45. - name: Build documentation
  46. run: make V=1 docs.clean docs.html
  47. - if: github.ref_name == 'master'
  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"