docs.yml 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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. docs-folder: "docs/"
  16. # Publish built docs to gh-pages branch.
  17. # ===============================
  18. - name: Commit documentation changes
  19. run: |
  20. git clone https://github.com/jbuisine/macop.git --branch gh-pages --single-branch gh-pages
  21. cp -r docs/build/html/* gh-pages/
  22. cd gh-pages
  23. touch .nojekyll
  24. git config --local user.email "action@github.com"
  25. git config --local user.name "GitHub Action"
  26. git add .
  27. git commit -m "Update documentation" -a || true
  28. # The above command will fail if no changes were present, so we ignore
  29. # that.
  30. - name: Push changes
  31. uses: ad-m/github-push-action@master
  32. with:
  33. branch: gh-pages
  34. directory: gh-pages
  35. github_token: ${{ secrets.GITHUB_TOKEN }}
  36. # ===============================