docs.yml 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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. cp -r docs gh-pages/docs
  24. cd gh-pages
  25. touch .nojekyll
  26. git config --local user.email "action@github.com"
  27. git config --local user.name "GitHub Action"
  28. git add .
  29. git commit -m "Update documentation" -a || true
  30. # The above command will fail if no changes were present, so we ignore
  31. # that.
  32. - name: Push changes
  33. uses: ad-m/github-push-action@master
  34. with:
  35. branch: gh-pages
  36. directory: gh-pages
  37. github_token: ${{ secrets.GITHUB_TOKEN }}
  38. # ===============================