From 3ad515952f4860dc3b4925d31778583b3b10a31d Mon Sep 17 00:00:00 2001 From: Anton Volkov Date: Tue, 1 Aug 2023 20:51:41 +0200 Subject: [PATCH 1/3] Added print event job --- .github/workflows/build-sphinx.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/build-sphinx.yml b/.github/workflows/build-sphinx.yml index 2258287ac0fc..ff24ed276d68 100644 --- a/.github/workflows/build-sphinx.yml +++ b/.github/workflows/build-sphinx.yml @@ -14,6 +14,16 @@ defaults: shell: bash -l {0} jobs: + print: + name: Print event + runs-on: ubuntu-latest + steps: + - name: Dump GitHub context + env: + GITHUB_CONTEXT: ${{ toJson(github) }} + run: | + echo "$GITHUB_CONTEXT" + build-and-deploy: name: Build and Deploy Docs From b36c777dd4228b923f70e0cce439d9a835395f4f Mon Sep 17 00:00:00 2001 From: Anton Volkov Date: Tue, 1 Aug 2023 21:10:52 +0200 Subject: [PATCH 2/3] Correct checks order for github.event --- .github/workflows/build-sphinx.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-sphinx.yml b/.github/workflows/build-sphinx.yml index ff24ed276d68..87b934701f1f 100644 --- a/.github/workflows/build-sphinx.yml +++ b/.github/workflows/build-sphinx.yml @@ -16,7 +16,7 @@ defaults: jobs: print: name: Print event - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 steps: - name: Dump GitHub context env: @@ -125,7 +125,7 @@ jobs: # https://github.com/marketplace/actions/github-pages-action - name: Deploy docs if: | - !github.event.pull_request.head.repo.fork && + github.event.pull_request && !github.event.pull_request.head.repo.fork && (github.ref == 'refs/heads/master' || (startsWith(github.ref, 'refs/heads/release') == true) || github.event_name == 'push' && contains(github.ref, 'refs/tags/')) uses: peaceiris/actions-gh-pages@v3.9.3 with: @@ -134,7 +134,7 @@ jobs: - name: Publish pull-request docs if: | - !github.event.pull_request.head.repo.fork && github.event.pull_request && github.event.action != 'closed' + github.event.pull_request && !github.event.pull_request.head.repo.fork && github.event.action != 'closed' uses: peaceiris/actions-gh-pages@v3.9.3 with: github_token: ${{ secrets.GITHUB_TOKEN }} @@ -149,7 +149,7 @@ jobs: - name: Comment with URL to published pull-request docs if: | - !github.event.pull_request.head.repo.fork && github.event.pull_request && github.event.action != 'closed' + github.event.pull_request && !github.event.pull_request.head.repo.fork && github.event.action != 'closed' env: PR_NUM: ${{ github.event.number }} uses: mshick/add-pr-comment@v2.8.1 @@ -160,7 +160,7 @@ jobs: clean: if: | - !github.event.pull_request.head.repo.fork && github.event.pull_request && github.event.action == 'closed' + github.event.pull_request && !github.event.pull_request.head.repo.fork && github.event.action == 'closed' needs: build-and-deploy From 44eb8e51f6050842fa552accf9f35ab1d892ff3e Mon Sep 17 00:00:00 2001 From: Anton Volkov Date: Tue, 1 Aug 2023 22:13:18 +0200 Subject: [PATCH 3/3] Dump GitHub context as action step --- .github/workflows/build-sphinx.yml | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build-sphinx.yml b/.github/workflows/build-sphinx.yml index 87b934701f1f..d9e6bad9965f 100644 --- a/.github/workflows/build-sphinx.yml +++ b/.github/workflows/build-sphinx.yml @@ -14,16 +14,6 @@ defaults: shell: bash -l {0} jobs: - print: - name: Print event - runs-on: ubuntu-20.04 - steps: - - name: Dump GitHub context - env: - GITHUB_CONTEXT: ${{ toJson(github) }} - run: | - echo "$GITHUB_CONTEXT" - build-and-deploy: name: Build and Deploy Docs @@ -39,6 +29,12 @@ jobs: with: access_token: ${{ github.token }} + - name: Dump GitHub context + env: + GITHUB_CONTEXT: ${{ toJson(github) }} + run: | + echo "$GITHUB_CONTEXT" + - name: Free Disk Space (Ubuntu) uses: jlumbroso/free-disk-space@main with: