From 843557af4a04ba23562a463e870828dab3ecc8e7 Mon Sep 17 00:00:00 2001 From: Janne Pulkkinen Date: Tue, 10 Sep 2024 09:48:30 +0000 Subject: [PATCH] Test publishing Sphinx docs using GitHub Pages --- .github/workflows/documentation.yml | 46 +++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/documentation.yml diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml new file mode 100644 index 0000000..0a0e9aa --- /dev/null +++ b/.github/workflows/documentation.yml @@ -0,0 +1,46 @@ +--- +name: documentation + +on: [push, pull_request] + +permissions: + contents: read + pages: write + id-token: write + +jobs: + build: + # Ubuntu 20.04 has Python 3.9 + runs-on: ubuntu-20.04 + + steps: + - uses: actions/checkout@v2 + - name: Set up Python 3.9 + uses: actions/setup-python@v2 + with: + python-version: "3.9" + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install -r requirements_github.txt + python -m pip install sphinx sphinx-autodoc-typehints + - name: Run Sphinx build + run: make doc + - name: Upload doc artifacts + uses: actions/upload-pages-artifact@v3 + with: + path: ./doc/build/html + + deploy: + # Only deploy on 'master' branch. It's probably still useful to check + # if the docs actually build on other branches, too. + if: github.ref == 'refs/heads/actions_test' + 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@v4