docs.yml 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. name: Build and Deploy Docs
  2. on:
  3. # Run on pushes targeting the default branch
  4. push:
  5. branches: [ master ]
  6. # Allows you to run this workflow manually from the Actions tab
  7. workflow_dispatch:
  8. # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
  9. permissions:
  10. contents: read
  11. pages: write
  12. id-token: write
  13. # Allow only one concurrent deployment, skipping runs queued between any
  14. # in-progress and latest queued runs. However, do not cancel in-progress runs
  15. # as we want to allow these production deployments to complete.
  16. concurrency:
  17. group: "pages"
  18. cancel-in-progress: false
  19. jobs:
  20. build:
  21. if: github.repository_owner == 'gearman'
  22. name: Build Docs
  23. runs-on: ubuntu-20.04
  24. steps:
  25. - name: Install Dependencies
  26. run: |
  27. sudo apt update && sudo apt install -y \
  28. apt-transport-https \
  29. apt-file \
  30. software-properties-common \
  31. build-essential \
  32. autotools-dev \
  33. autoconf \
  34. automake \
  35. make \
  36. pkgconf \
  37. libboost-all-dev \
  38. libevent-dev \
  39. gperf \
  40. uuid-dev \
  41. sphinx-doc \
  42. sphinx-common \
  43. python3-sphinx
  44. - name: Clone Repository
  45. uses: actions/checkout@v4
  46. - name: Bootstrap
  47. run: |
  48. if [ -f "/etc/lsb-release" ]; then
  49. cat /etc/lsb-release
  50. fi
  51. ./bootstrap.sh -a
  52. shell: bash
  53. - name: Configure
  54. run: |
  55. ./configure
  56. shell: bash
  57. - name: Build HTML Documentation
  58. run: make -C docs dirhtml
  59. - name: Setup Pages
  60. uses: actions/configure-pages@v5
  61. - name: Upload Artifacts
  62. uses: actions/upload-pages-artifact@v3
  63. with:
  64. path: 'docs/build/dirhtml'
  65. deploy:
  66. if: github.repository_owner == 'gearman'
  67. name: Deploy Docs
  68. # Add a dependency on the build job
  69. needs: build
  70. runs-on: ubuntu-latest
  71. environment:
  72. name: github-pages
  73. url: ${{ steps.deployment.outputs.page_url }}
  74. steps:
  75. - name: Deploy to GitHub Pages
  76. id: deployment
  77. uses: actions/deploy-pages@v4