From a972b9445888e54f305231ea6352144879e0635d Mon Sep 17 00:00:00 2001 From: Aaron Steers Date: Fri, 16 Feb 2024 09:58:53 -0800 Subject: [PATCH] update publish flow --- .github/workflows/pydoc_publish.yml | 38 +++++++++++++++++++++++------ 1 file changed, 31 insertions(+), 7 deletions(-) diff --git a/.github/workflows/pydoc_publish.yml b/.github/workflows/pydoc_publish.yml index 3923a8bb..f0537ff8 100644 --- a/.github/workflows/pydoc_publish.yml +++ b/.github/workflows/pydoc_publish.yml @@ -1,13 +1,31 @@ -name: Generate Python Documentation +name: Publish Documentation Site on: push: branches: - main + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# 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. +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. +concurrency: + group: "pages" + cancel-in-progress: false + jobs: - build: + deploy: runs-on: ubuntu-latest + environment: + name: "github-pages" + url: ${{ steps.deployment.outputs.page_url }} steps: - name: Checkout code @@ -21,16 +39,22 @@ jobs: with: python-version: '3.10' cache: 'poetry' + - name: Setup Pages + uses: actions/configure-pages@v4 - name: Install dependencies run: poetry install - name: Generate documentation run: | - pdoc --html --output-dir docs . + poetry run generate-docs - - name: Deploy to GitHub Pages - uses: peaceiris/actions-gh-pages@v3 + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./docs + # Upload entire repository + path: '.' + + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4