Skip to content

Commit d36b252

Browse files
committed
ci: strip stable noindex before pruning deploy noise
The prune step reverts files whose only diff versus gh-pages is build noise. Stable pages are the canonical indexed version, so their noindex robots meta is stripped after deploy — HEAD has no noindex, but a fresh Sphinx build does. With the strip running after the prune, every rebuilt stable file still carried that meta at prune time, counted as a real change, and was kept. The later strip then removed the meta, leaving the file differing from HEAD by only the build timestamp — exactly the noise the prune was meant to drop. Result: the stable folder shipped hundreds of timestamp-only files (e.g. 255 in one deploy) while 32/33/34, which are never stripped, pruned correctly. Move the noindex strip ahead of the prune so noise-only stable pages match HEAD and get reverted like every other version. Assisted-by: ClaudeCode:claude-opus-4-8 Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
1 parent d438b25 commit d36b252

1 file changed

Lines changed: 12 additions & 9 deletions

File tree

.github/workflows/deploy-docs.yml

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,18 @@ jobs:
178178
# Cleanup empty directories
179179
find . -type d -empty -delete
180180
181+
# Strip noindex from stable docs BEFORE pruning. Sphinx always emits a
182+
# noindex robots meta, but the deployed stable pages have it stripped
183+
# (they are the canonical, indexed version). If we pruned first, every
184+
# rebuilt stable file would still carry that meta and so differ from
185+
# HEAD by a "real" line — defeating the prune and leaving timestamp-only
186+
# files in the PR. Stripping first makes noise-only stable pages match
187+
# HEAD, so the prune below can revert them.
188+
if [ -d server/stable ]; then
189+
find server/stable -name '*.html' -print0 | \
190+
xargs -0 perl -pi -e 's{<meta name="robots" content="noindex, follow" />\n?}{}g'
191+
fi
192+
181193
# ----------------------------------------------------------------
182194
# Prune build-only noise so the PR carries exclusively real content
183195
# changes. A rebuilt page differs every night even when its content
@@ -237,15 +249,6 @@ jobs:
237249
echo "::notice::Skipping deploy PR: only build noise (timestamps, mermaid ids, binaries) changed"
238250
fi
239251
240-
- name: Strip noindex from stable docs
241-
if: steps.apply.outputs.has_changes == 'true'
242-
run: |
243-
# Strip noindex from stable docs – these are the canonical pages we want indexed
244-
if [ -d server/stable ]; then
245-
find server/stable -name '*.html' -print0 | \
246-
xargs -0 perl -pi -e 's{<meta name="robots" content="noindex, follow" />\n?}{}g'
247-
fi
248-
249252
- name: Write robots.txt
250253
if: steps.apply.outputs.has_changes == 'true'
251254
run: |

0 commit comments

Comments
 (0)