Skip to content

Commit ecae265

Browse files
authored
Merge pull request #15290 from nextcloud/fix/deploy-prune-stable-noindex
ci: strip stable noindex before pruning deploy noise
2 parents d438b25 + d36b252 commit ecae265

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)