diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 59cb3a2..c494b43 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -19,7 +19,7 @@ jobs: deploy: environment: name: github-pages - url: ${{ steps.deployment.outputs.page_url }} + url: ${{ steps.deployment_retry.outputs.page_url || steps.deployment.outputs.page_url }} runs-on: ubuntu-latest steps: - name: Check out repository @@ -63,4 +63,10 @@ jobs: - name: Deploy Pages artifact id: deployment + continue-on-error: true + uses: actions/deploy-pages@v5 + + - name: Retry Pages deploy once on transient failure + id: deployment_retry + if: ${{ steps.deployment.outcome == 'failure' }} uses: actions/deploy-pages@v5 diff --git a/test/pages-artifact.test.mjs b/test/pages-artifact.test.mjs index 934e445..133d15d 100644 --- a/test/pages-artifact.test.mjs +++ b/test/pages-artifact.test.mjs @@ -73,5 +73,11 @@ assert( pagesWorkflow.includes("actions/deploy-pages@v5"), "Pages workflow should use current GitHub Pages action majors" ); +assert( + pagesWorkflow.includes("continue-on-error: true") && + pagesWorkflow.includes("Retry Pages deploy once on transient failure") && + pagesWorkflow.includes("steps.deployment.outcome == 'failure'"), + "Pages workflow should retry deploy-pages once when the first deploy attempt fails" +); console.log("GitHub Pages artifact checks look good.");