Skip to content

Commit cec9487

Browse files
tannevaledclaude
andauthored
docs.yml: wait for the Pages build of the pushed gh-pages commit (#15)
The deploy job of docs.yml now runs pagesbuild on the gh-pages commit it pushed (only when something was pushed). GitHub's legacy "pages build and deployment" sometimes stalls in updating_pages and times out, and a green push is then not a published site; pagesbuild waits for a build of that commit, requests a new one when needed, and fails the job if the site is still not built. Same change as go-redfish/docs#11 (merge 1beaa7d), made by pagesbuildadd: 'pages: write' on the deploy job, 'id: push' and the pushed SHA as an output of "Push gh-pages", and a "Wait for the Pages build" step running pagesbuild@v0.80.0. Proven in production by https://github.com/go-redfish/docs/actions/runs/42268708918: pagesbuild requested a rebuild after a 5 minute stall and the commit was built two minutes later. Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
1 parent 3bc73ed commit cec9487

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

‎.github/workflows/docs.yml‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ jobs:
106106
runs-on: ubuntu-latest
107107
permissions:
108108
contents: write
109+
pages: write
109110
steps:
110111
- uses: actions/checkout@v7
111112
with:
@@ -150,6 +151,7 @@ jobs:
150151
"${{ needs.build.outputs.version }}" site gh-pages
151152
152153
- name: Push gh-pages
154+
id: push
153155
working-directory: gh-pages
154156
run: |
155157
git config user.name "github-actions[bot]"
@@ -161,3 +163,22 @@ jobs:
161163
fi
162164
git commit -q -m "Deployed ${GITHUB_SHA::7} to ${{ needs.build.outputs.version }} with Hugo ${HUGO_VERSION}"
163165
git push origin HEAD:gh-pages
166+
echo "sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
167+
168+
# ⛔ A GREEN PUSH IS NOT A PUBLISHED SITE. GitHub's legacy "pages build and
169+
# deployment" for the gh-pages branch sometimes stalls in updating_pages and
170+
# fails with "Timeout reached, aborting!" after 10 minutes (3 times on
171+
# 2026-11-05/06, runs 42058763350 and 42252993462); re-running it does not
172+
# help and re-running this workflow pushes nothing. pagesbuild waits for a
173+
# build of the pushed commit to be "built", requests a new one when it is
174+
# not, and fails this job if the site is still not built.
175+
- name: Wait for the Pages build
176+
if: steps.push.outputs.sha != ''
177+
env:
178+
GH_TOKEN: ${{ github.token }}
179+
run: |
180+
umask 077
181+
printf '%s' "${GH_TOKEN}" > "${RUNNER_TEMP}/pages-token"
182+
go run github.com/go-fleettools/fleettools/cmd/pagesbuild@v0.80.0 \
183+
--token-file "${RUNNER_TEMP}/pages-token" \
184+
"${GITHUB_REPOSITORY}" "${{ steps.push.outputs.sha }}"

0 commit comments

Comments
 (0)