docbuild.yaml 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. name: Documentation Build
  2. on:
  3. pull_request:
  4. types: [opened, synchronize, reopened]
  5. branches:
  6. - master
  7. paths:
  8. - '.github/workflows/docbuild.yaml'
  9. - '**.md'
  10. - 'docs/**'
  11. push:
  12. branches:
  13. - master
  14. permissions:
  15. contents: write
  16. jobs:
  17. build-and-publish:
  18. runs-on: ubuntu-latest
  19. steps:
  20. - name: Checkout the code
  21. uses: actions/checkout@v4
  22. with:
  23. path: matter
  24. fetch-depth: 0
  25. - name: Install Python
  26. uses: actions/setup-python@v4
  27. with:
  28. python-version: 3.8
  29. cache-dependency-path: matter/docs/requirements.txt
  30. cache: pip
  31. - name: Install base dependencies
  32. working-directory: matter
  33. run: |
  34. sudo pip3 install -U pip
  35. pip3 install -r docs/requirements.txt
  36. - name: Build documentation
  37. working-directory: matter/docs
  38. run: |
  39. mkdir -p _build/src
  40. make html
  41. touch _build/html/.nojekyll
  42. - name: Deploy to gh-pages
  43. if: github.repository == 'project-chip/connectedhomeip' && github.event_name == 'push' && github.ref_name == 'master'
  44. uses: peaceiris/actions-gh-pages@v3
  45. with:
  46. deploy_key: ${{ secrets.DOXYGEN_DEPLOY_KEY }}
  47. external_repository: project-chip/connectedhomeip-doc
  48. publish_dir: matter/docs/_build/html
  49. # Keep only the latest version of the documentation
  50. force_orphan: true