From 94c273b1cbbbdb870c94bed6e42b3d653e5d2b79 Mon Sep 17 00:00:00 2001 From: Remco de Boer <29308176+redeboer@users.noreply.github.com> Date: Thu, 19 Oct 2023 15:35:56 +0200 Subject: [PATCH] DX: host GitHub Pages on fork as PR preview (#21) * MAINT: update workflow actions --- .github/workflows/docs.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 9d7b92f..e13fef8 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -2,8 +2,6 @@ name: Documentation on: push: - branches: - - main pull_request: branches: - main @@ -11,10 +9,11 @@ on: jobs: doc: + if: github.event_name == 'push' && (github.repository != 'ComPWA/strong2020-salamanca' || github.ref_name == 'main') || github.event_name == 'pull_request' name: Execute and build runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: "3.10" @@ -38,17 +37,17 @@ jobs: path: | ./docs/data - run: jupyter book build docs/ -W - - uses: actions/upload-pages-artifact@v1 + - uses: actions/upload-pages-artifact@v2 if: always() with: path: ./docs/_build/html gh-pages: + if: github.event_name == 'push' && (github.repository != 'ComPWA/strong2020-salamanca' || github.ref_name == 'main') name: Upload to GitHub Pages environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} - if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch) needs: - doc permissions: