From 566ad6d8699306f48bf8789e8e8a6748757c0730 Mon Sep 17 00:00:00 2001 From: leo60228 Date: Tue, 25 Jun 2024 05:10:52 -0400 Subject: [PATCH] Don't try to deploy to GitHub Pages if it's not enabled (#4809) --- .github/workflows/docs.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 244976ea1ef3..874ebdd5906a 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -26,8 +26,18 @@ jobs: run: | cd docs mdbook build + - name: Check if Pages is enabled + uses: octokit/request-action@v2.x + id: check_pages + continue-on-error: true + with: + route: GET /repos/{repo}/pages + repo: ${{ github.repository }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Setup Pages uses: actions/configure-pages@v4 + if: steps.check_pages.outcome == 'success' - name: Upload artifact uses: actions/upload-pages-artifact@v3 with: @@ -35,3 +45,4 @@ jobs: - name: Deploy to GitHub Pages id: deployment uses: actions/deploy-pages@v4 + if: steps.check_pages.outcome == 'success'