From f6756a38f92f388981fd1161818bd18a5d5a5731 Mon Sep 17 00:00:00 2001 From: Garry O'Donnell Date: Wed, 3 May 2023 14:38:30 +0000 Subject: [PATCH 1/3] Use actions/github-pages to publish docs --- .github/workflows/docs.yml | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index c510d577..a8a52419 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -8,7 +8,12 @@ jobs: docs: if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository runs-on: ubuntu-latest - + permissions: + pages: write + id-token: write + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} steps: - name: Avoid git conflicts when tag and branch pushed at same time if: startsWith(github.ref, 'refs/tags') @@ -42,12 +47,12 @@ jobs: - name: Write switcher.json run: python .github/pages/make_switcher.py --add $DOCS_VERSION ${{ github.repository }} .github/pages/switcher.json - - name: Publish Docs to gh-pages - if: github.event_name == 'push' && github.actor != 'dependabot[bot]' - # We pin to the SHA, not the tag, for security reasons. - # https://docs.github.com/en/actions/learn-github-actions/security-hardening-for-github-actions#using-third-party-actions - uses: peaceiris/actions-gh-pages@64b46b4226a4a12da2239ba3ea5aa73e3163c75b # v3.9.1 + - name: Upload Pages artifact + uses: actions/upload-pages-artifact@v1.0.8 with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: .github/pages - keep_files: true + path: .github/pages + + - name: Publish docs to GitHub Pages + if: github.event_name == 'push' && github.actor != 'dependabot[bot]' + id: deployment + uses: actions/github-pages@v2.0.1 From d8dc2eea592272b04ad05802f54fd875fef284b3 Mon Sep 17 00:00:00 2001 From: Garry O'Donnell Date: Wed, 3 May 2023 14:45:39 +0000 Subject: [PATCH 2/3] Add configure pages step --- .github/workflows/docs.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index a8a52419..eefbe3e1 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -47,6 +47,9 @@ jobs: - name: Write switcher.json run: python .github/pages/make_switcher.py --add $DOCS_VERSION ${{ github.repository }} .github/pages/switcher.json + - name: Setup Pages + uses: actions/configure-pages@v3 + - name: Upload Pages artifact uses: actions/upload-pages-artifact@v1.0.8 with: From 796150e7c7b1ea5bf3ce0c41e0f739bc54556831 Mon Sep 17 00:00:00 2001 From: Garry O'Donnell Date: Wed, 3 May 2023 14:51:23 +0000 Subject: [PATCH 3/3] Fix action name --- .github/workflows/docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index eefbe3e1..9252b401 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -58,4 +58,4 @@ jobs: - name: Publish docs to GitHub Pages if: github.event_name == 'push' && github.actor != 'dependabot[bot]' id: deployment - uses: actions/github-pages@v2.0.1 + uses: actions/deploy-pages@v2.0.1