From 2b77cd8edf01347c5605473e55c4e310c47b606c Mon Sep 17 00:00:00 2001 From: arxyzan Date: Tue, 15 Aug 2023 20:17:26 +0330 Subject: [PATCH] Update docs workflow --- .github/workflows/sphinx.yml | 42 ++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/.github/workflows/sphinx.yml b/.github/workflows/sphinx.yml index e00a3eca..8f994434 100644 --- a/.github/workflows/sphinx.yml +++ b/.github/workflows/sphinx.yml @@ -1,24 +1,24 @@ -name: "Sphinx: Render docs" - -on: push - +name: Docs +on: [push, pull_request, workflow_dispatch] +permissions: + contents: write jobs: - build: + docs: runs-on: ubuntu-latest - permissions: - contents: write steps: - - uses: actions/checkout@v3 - - name: Build HTML - uses: ammaraskar/sphinx-action@master - - name: Upload artifacts - uses: actions/upload-artifact@v3 - with: - name: html-docs - path: docs/build/html/ - - name: Deploy - uses: peaceiris/actions-gh-pages@v3 - if: github.ref == 'refs/heads/main' - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: docs/build/html \ No newline at end of file + - uses: actions/checkout@v3 + - uses: actions/setup-python@v3 + - name: Install dependencies + run: | + pip install sphinx sphinx_rtd_theme furo + - name: Sphinx build + run: | + sphinx-build doc _build + - name: Deploy + 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: _build/ + force_orphan: true \ No newline at end of file