| commit 6b2845b0db346b79379f17444877e1a05e216e12 parent 21014fcefe2efa3f3aa386e2aeca9db5d6538423 Author: sqzer <110329244+sqzer-x@users.noreply.github.com> Date: Sun, 26 Jul 2026 00:02:42 +0900 Retry a Pages deployment that lost a race with the previous one `concurrency: group: pages` serialises workflow *runs*. It does not serialise what GitHub does after one finishes — the Pages deployment outlives the run that created it, and a run that starts inside that window gets a 400: "Deployment request failed … due to in progress deployment." Pushing four commits inside ten minutes hit it. One deploy was cancelled out of the queue by the next arrival and two more failed against a deployment the Deployments API was already reporting as successful. So the deploy step now tolerates that one failure, waits, and tries once more. It is safe to retry precisely because the request fails before changing anything: there is no half-deployed state to land in, only a deployment that was never created. This does not fix the case where GitHub's own state is stuck rather than merely busy — the cancel endpoint answering "already finished" while the deploy endpoint says "still in progress" is not something a workflow can resolve. For that the answer is to re-run once it clears. Diffstat:
|
| 1 file changed, 18 insertion(+), 1 deletion(-) |
diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml @@ -47,7 +47,24 @@ jobs: runs-on: ubuntu-latest environment: name: github-pages - url: ${{ steps.deployment.outputs.page_url }} + url: ${{ steps.deployment.outputs.page_url || steps.retry.outputs.page_url }} steps: + # 위의 concurrency는 **워크플로 실행**을 직렬화한다. Pages 배포는 그보다 오래 + # 산다 — 앞선 실행이 끝난 뒤에도 GitHub 쪽에서 처리 중일 수 있고, 그 창에 + # 들어가면 400 "due to in progress deployment"로 죽는다. 커밋을 연달아 밀면 + # 실제로 걸린다. + # + # 앞선 배포는 어차피 곧 끝나므로, 기다렸다 한 번 더 시도하면 된다. 배포가 + # 상태를 바꾸기 전에 실패하는 것이라 재시도가 사이트를 반쯤 갱신된 상태로 + # 만들지 않는다. - id: deployment uses: actions/deploy-pages@v5 + continue-on-error: true + + - name: Wait for the previous deployment to settle + if: steps.deployment.outcome == 'failure' + run: sleep 90 + + - id: retry + if: steps.deployment.outcome == 'failure' + uses: actions/deploy-pages@v5 |