From 699022439f854a62a4a4fc7a382ed04a672a2b48 Mon Sep 17 00:00:00 2001 From: Michael-J-Ward Date: Fri, 10 May 2024 16:37:02 -0500 Subject: [PATCH] ci: modify docs job to run on pull requests but only push on main This should ensure that docs will still build on any merge but only push the generated HTML once it hits main. --- .github/workflows/docs.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 1193d7810..855164852 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -4,6 +4,9 @@ on: - main tags-ignore: - "**-rc**" + pull_request: + branches: + - main name: Deploy DataFusion Python site @@ -13,6 +16,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Set target branch + if: github.event_name == 'push' && github.ref == 'refs/heads/main' id: target-branch run: | set -x @@ -27,6 +31,7 @@ jobs: - name: Checkout docs sources uses: actions/checkout@v3 - name: Checkout docs target branch + if: github.event_name == 'push' && github.ref == 'refs/heads/main' uses: actions/checkout@v3 with: fetch-depth: 0 @@ -64,6 +69,7 @@ jobs: make html - name: Copy & push the generated HTML + if: github.event_name == 'push' && github.ref == 'refs/heads/main' run: | set -x cd docs-target