update workflow #12
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: Deploy Sphinx documentation to Pages | |
on: | |
push: | |
branches: [docs] # Set a branch to deploy when pushed | |
pull_request: | |
branches: [docs] # Set a branch to deploy when a PR is made | |
workflow_dispatch: # Allows you to run this workflow manually from the Actions tab | |
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. | |
concurrency: | |
group: "pages" | |
cancel-in-progress: false | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.9' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install sphinx furo sphinx-autodoc-typehints | |
- name: Add firmware to PYTHONPATH | |
run: echo "PYTHONPATH=$PYTHONPATH:${{ github.workspace }}" >> $GITHUB_ENV | |
- name: Install firmware package | |
run: pip install -e . | |
- name: Generate documentation | |
run: | | |
cd docs | |
make all | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v1 | |
with: | |
path: docs/_build/html | |
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 | |
uses: actions/deploy-pages@v2 |