python-resources.yml 1.3 KB

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