From 99eba7cc64fb6b135b05fceb508b2fe817703a65 Mon Sep 17 00:00:00 2001 From: Ashley Smith Date: Wed, 14 Feb 2024 16:17:17 +0000 Subject: [PATCH] Return to separate build/deploy jobs. Run deploy even on failure --- .github/workflows/publish.yml | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index dc62b1a..99d6cde 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -11,14 +11,6 @@ jobs: build: name: Build Jupyter Book runs-on: ubuntu-latest - # Grant GITHUB_TOKEN the permissions required to make a Pages deployment - permissions: - pages: write # to deploy to Pages - id-token: write # to verify the deployment originates from an appropriate source - # Deploy to the github-pages environment - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} steps: # Set up the execution environment - name: Checkout repository @@ -40,15 +32,29 @@ jobs: conda run -n bookbuilder \ pytest --numprocesses auto --nbmake --overwrite --nbmake-kernel=igrf notebooks/*.ipynb - name: Build jupyter book - id: build-book - if: always() + if: success() || failure() shell: bash -el {0} run: conda run -n bookbuilder jupyter-book build . - # Push the resulting html to GitHub Pages - name: Upload artifact to pass to GitHub Pages + if: success() || failure() uses: actions/upload-pages-artifact@v3 with: path: _build/html + deploy: + name: Deploy to GitHub Pages + needs: build + if: success() || failure() + # Grant GITHUB_TOKEN the permissions required to make a Pages deployment + permissions: + pages: write # to deploy to Pages + id-token: write # to verify the deployment originates from an appropriate source + # Deploy to the github-pages environment + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + # Specify runner + deployment step + runs-on: ubuntu-latest + steps: - name: Deploy to GitHub Pages id: deployment uses: actions/deploy-pages@v4