docs.yml 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. name: Generate Docs
  2. permissions:
  3. contents: write
  4. on:
  5. push:
  6. branches:
  7. - master
  8. paths:
  9. - 'builddefs/docsgen/**'
  10. - 'tmk_core/**'
  11. - 'quantum/**'
  12. - 'platforms/**'
  13. - 'docs/**'
  14. - '.github/workflows/docs.yml'
  15. pull_request:
  16. paths:
  17. - 'builddefs/docsgen/**'
  18. - 'docs/**'
  19. - '.github/workflows/docs.yml'
  20. defaults:
  21. run:
  22. shell: bash
  23. jobs:
  24. generate:
  25. runs-on: ubuntu-latest
  26. container: ghcr.io/qmk/qmk_cli
  27. steps:
  28. - uses: actions/checkout@v6
  29. with:
  30. fetch-depth: 1
  31. - name: Install dependencies
  32. run: |
  33. apt-get update && apt-get install -y rsync doxygen
  34. # install nvm
  35. touch $HOME/.bashrc
  36. wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
  37. - name: Install node
  38. run: |
  39. source $HOME/.bashrc
  40. nvm install 20
  41. nvm use 20
  42. corepack enable
  43. - name: Build docs
  44. run: |
  45. source $HOME/.bashrc
  46. nvm use 20
  47. qmk --verbose generate-docs
  48. - name: Deploy
  49. if: ${{ github.event_name == 'push' && github.repository == 'qmk/qmk_firmware' }}
  50. uses: JamesIves/github-pages-deploy-action@v4.7.4
  51. with:
  52. token: ${{ secrets.GITHUB_TOKEN }}
  53. branch: gh-pages
  54. folder: .build/docs
  55. git-config-name: QMK Bot
  56. git-config-email: hello@qmk.fm
  57. - name: Deploy Develop
  58. if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/develop' && github.repository == 'qmk/qmk_firmware' }}
  59. uses: actions/github-script@v6
  60. with:
  61. github-token: ${{ secrets.QMK_BOT_TOKEN }}
  62. script: |
  63. const result = await github.rest.actions.createWorkflowDispatch({
  64. owner: 'qmk',
  65. repo: 'qmk_docs_devel',
  66. workflow_id: 'develop.yml',
  67. ref: 'main',
  68. })