Skip to content

Commit 901f745

Browse files
authored
Merge pull request #309 from HackTricks-wiki/hermes/reduce-cloudfront-invalidation-paths
Reduce redundant CloudFront invalidation paths
2 parents db20d27 + 50de879 commit 901f745

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
@@ -178,7 +178,9 @@ jobs:
178178
179179
- name: Invalidate CloudFront HTML and SEO assets
180180
run: |
181+
# /en/* covers /en/robots.txt and /en/sitemap.xml; only invalidate
182+
# root SEO files separately.
181183
aws cloudfront create-invalidation \
182184
--distribution-id "${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }}" \
183-
--paths "/en/*" "/robots.txt" "/en/robots.txt" "/sitemap.xml" "/en/sitemap.xml"
185+
--paths "/en/*" "/robots.txt" "/sitemap.xml"
184186

.github/workflows/translate_all.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,9 @@ jobs:
296296
shell: bash
297297
run: |
298298
set -euo pipefail
299-
paths=("/$BRANCH/*" "/$BRANCH/sitemap.xml")
299+
# The wildcard already invalidates the language sitemap, so avoid
300+
# paying for a redundant explicit /$BRANCH/sitemap.xml path.
301+
paths=("/$BRANCH/*")
300302
if [ "${{ steps.root_sitemap.outputs.changed }}" = "true" ]; then
301303
paths+=("/sitemap.xml")
302304
fi

0 commit comments

Comments
 (0)