doc.yml 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. name: generate doc
  2. on:
  3. push:
  4. branches:
  5. - 'main'
  6. - 'develop-[0-9]+.[0-9]+.[0-9]+'
  7. schedule:
  8. - cron: '0 8 * * *'
  9. workflow_dispatch: {}
  10. concurrency:
  11. group: doc_generator_${{ github.ref_name }}
  12. cancel-in-progress: true
  13. jobs:
  14. doc_generator:
  15. name: generate doc on branch ${{ github.ref_name }}
  16. runs-on: ubuntu-latest
  17. steps:
  18. - name: check out the repo
  19. uses: actions/checkout@v2
  20. - name: fetch gh-pages
  21. continue-on-error: true
  22. run: git fetch origin gh-pages --depth=1
  23. - name: configure a git user
  24. run: |
  25. git config user.name github-actions[bot]
  26. git config user.email 41898282+github-actions[bot]@users.noreply.github.com
  27. - name: install python packages
  28. run: pip install -Ur doc/mkdocs/requirements.txt
  29. - name: build doc via mike
  30. shell: bash
  31. run: |
  32. VERSION='${{ github.ref_name }}'
  33. [ "$VERSION" == main ] && { VERSION=latest; ALIAS='main master'; }
  34. VERSION="${VERSION#develop-}"
  35. mike deploy --push --update-aliases "$VERSION" $ALIAS
  36. mike set-default --push latest