add workflow to deploy docs and remove built HTML from source control #6
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Sphinx build | |
on: | |
push: | |
branches: [master] | |
pull_request: | |
branches: [master] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Build HTML | |
uses: ammaraskar/sphinx-action@master | |
with: | |
docs-folder: "." | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: html-docs | |
path: build/html/ | |
# - name: Deploy | |
# uses: peaceiris/actions-gh-pages@v3 | |
# if: github.ref == 'refs/heads/main' | |
# with: | |
# github_token: ${{ secrets.GITHUB_TOKEN }} | |
# publish_dir: _build/html | |
# Deployment job | |
deploy: | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
if: github.ref == 'refs/heads/master' | |
uses: actions/deploy-pages@v4 | |