docs.yml 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. name: Documentation
  2. on:
  3. push:
  4. branches:
  5. - master
  6. - develop
  7. jobs:
  8. build:
  9. runs-on: ubuntu-latest
  10. steps:
  11. - uses: actions/checkout@v1
  12. # Standard drop-in approach that should work for most people.
  13. - uses: ammaraskar/sphinx-action@master
  14. with:
  15. pre-build-command: "pip install asteroid-sphinx-theme"
  16. build-command: "make html"
  17. docs-folder: "docs"
  18. # Publish built docs to gh-pages branch.
  19. # ===============================
  20. - name: Commit documentation changes
  21. run: |
  22. git clone https://github.com/jbuisine/macop.git --branch gh-pages --single-branch gh-pages
  23. ls -l docs/_build
  24. cp -r docs/* gh-pages/docs
  25. cd gh-pages
  26. touch .nojekyll
  27. git config --local user.email "action@github.com"
  28. git config --local user.name "GitHub Action"
  29. git add .
  30. git commit -m "Update documentation" -a || true
  31. # The above command will fail if no changes were present, so we ignore
  32. # that.
  33. - name: Push changes
  34. uses: ad-m/github-push-action@master
  35. with:
  36. branch: gh-pages
  37. directory: gh-pages
  38. github_token: ${{ secrets.GITHUB_TOKEN }}
  39. # ===============================