From 386498f53e44f0587de110bed85b3b2900ca1848 Mon Sep 17 00:00:00 2001 From: shubh Date: Mon, 25 Nov 2024 09:17:24 +0100 Subject: [PATCH 1/3] pl --- .github/workflows/publish_doc.yml | 70 ++++++++++++------------------- 1 file changed, 27 insertions(+), 43 deletions(-) diff --git a/.github/workflows/publish_doc.yml b/.github/workflows/publish_doc.yml index 4e7a49c..aaa43cb 100644 --- a/.github/workflows/publish_doc.yml +++ b/.github/workflows/publish_doc.yml @@ -1,52 +1,36 @@ -name: Publish Docs to GitHub Pages +# .github/workflows/deploy-docs.yml +name: Deploy Documentation to GitHub Pages on: push: branches: - - release # Only trigger on the release branch - -permissions: - contents: read - pages: write # Required for GitHub Pages API - id-token: write # Required for authentication + - release # Change this if your default branch is not 'main' + workflow_dispatch: jobs: - build: - runs-on: ubuntu-latest + build-and-deploy: + runs-on: ubuntu-22.04 steps: - - name: Checkout code - uses: actions/checkout@v3 + - name: Checkout repository + uses: actions/checkout@v3 - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: '3.11.9' - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install . - pip install sphinx==7.4.7 # Install Sphinx and theme if needed - - name: Move to docs folder - run: | - cd docs - - name: Build Sphinx Docs - run: | - make html - - name: List files in build directory - run: ls -R ./build/html - - name: Upload static files as artifact - id: deployment - uses: actions/upload-pages-artifact@v3 - with: - path: 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@v4 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: 3.11 + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r docs/source/requirements.txt + + - name: Build documentation + run: | + sphinx-build docs/source docs/build/html + + - name: Deploy to GitHub Pages + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: docs/build/html From 98468770afc502ab490963fe28e2be805ca5e175 Mon Sep 17 00:00:00 2001 From: shubh Date: Mon, 25 Nov 2024 11:31:56 +0100 Subject: [PATCH 2/3] fix --- .github/workflows/publish_doc.yml | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/.github/workflows/publish_doc.yml b/.github/workflows/publish_doc.yml index aaa43cb..ae53c03 100644 --- a/.github/workflows/publish_doc.yml +++ b/.github/workflows/publish_doc.yml @@ -8,7 +8,7 @@ on: workflow_dispatch: jobs: - build-and-deploy: + build: runs-on: ubuntu-22.04 steps: @@ -28,9 +28,18 @@ jobs: - name: Build documentation run: | sphinx-build docs/source docs/build/html - - - name: Deploy to GitHub Pages - uses: peaceiris/actions-gh-pages@v3 + - name: Upload static files as artifact + id: deployment + uses: actions/upload-pages-artifact@v3 with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: docs/build/html + 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@v4 From b3031aa1c9f5ddc7ffea5580dc1fcbb2a8b42a36 Mon Sep 17 00:00:00 2001 From: shubh Date: Mon, 25 Nov 2024 11:38:01 +0100 Subject: [PATCH 3/3] per fix --- .github/workflows/publish_doc.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/publish_doc.yml b/.github/workflows/publish_doc.yml index ae53c03..e3dd7bd 100644 --- a/.github/workflows/publish_doc.yml +++ b/.github/workflows/publish_doc.yml @@ -7,6 +7,11 @@ on: - release # Change this if your default branch is not 'main' workflow_dispatch: +permissions: + contents: read + pages: write # Required for GitHub Pages API + id-token: write # Required for authentication + jobs: build: runs-on: ubuntu-22.04