diff --git a/.github/workflows/build_documentation.yml b/.github/workflows/build_documentation.yml new file mode 100644 index 00000000..a6358f88 --- /dev/null +++ b/.github/workflows/build_documentation.yml @@ -0,0 +1,45 @@ +name: Build the documentation + +on: + workflow_dispatch: + + push: + + pull_request: + branches: [main] + +permissions: + contents: write + +jobs: + build: + name: Build + runs-on: ubuntu-latest + steps: + - name: Checkout the branch + uses: actions/checkout@v3 + with: + persist-credentials: false + + - name: Set up Python 3.9 + uses: actions/setup-python@v3 + with: + python-version: 3.9 + + - name: Install dependencies + run: | + pip install sphinx sphinx_rtd_theme myst_parser + + - name: Build the documentation with Sphinx + run: | + pip install -e . + sphinx-build -b html docs/source docs/build/html + + - name: Deploy to GitHub Pages + uses: peaceiris/actions-gh-pages@v3 + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} + with: + publish_branch: gh-pages + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: docs/build/html + force_orphan: true \ No newline at end of file