Skip to content

Commit d7fbf46

Browse files
authored
Merge pull request #2401 from HackTricks-wiki/hermes/reduce-cloudfront-invalidation-paths
Reduce redundant CloudFront invalidation paths
2 parents 3dd968c + f07a8f2 commit d7fbf46

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

.github/workflows/build_master.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,9 @@ jobs:
202202
203203
- name: Invalidate CloudFront HTML and SEO assets
204204
run: |
205+
# /en/* covers /en/robots.txt and /en/sitemap.xml; only invalidate
206+
# root SEO files separately.
205207
aws cloudfront create-invalidation \
206208
--distribution-id "${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }}" \
207-
--paths "/en/*" "/robots.txt" "/en/robots.txt" "/sitemap.xml" "/en/sitemap.xml"
209+
--paths "/en/*" "/robots.txt" "/sitemap.xml"
208210

.github/workflows/translate_all.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,9 @@ jobs:
290290
shell: bash
291291
run: |
292292
set -euo pipefail
293-
paths=("/$BRANCH/*" "/$BRANCH/sitemap.xml")
293+
# The wildcard already invalidates the language sitemap, so avoid
294+
# paying for a redundant explicit /$BRANCH/sitemap.xml path.
295+
paths=("/$BRANCH/*")
294296
if [ "${{ steps.root_sitemap.outputs.changed }}" = "true" ]; then
295297
paths+=("/sitemap.xml")
296298
fi

0 commit comments

Comments
 (0)