mirror of
https://github.com/HackTricks-wiki/hacktricks-cloud.git
synced 2026-07-28 14:47:17 -07:00
Reduce redundant CloudFront invalidation paths
This commit is contained in:
@@ -178,7 +178,9 @@ jobs:
|
|||||||
|
|
||||||
- name: Invalidate CloudFront HTML and SEO assets
|
- name: Invalidate CloudFront HTML and SEO assets
|
||||||
run: |
|
run: |
|
||||||
|
# /en/* covers /en/robots.txt and /en/sitemap.xml; only invalidate
|
||||||
|
# root SEO files separately.
|
||||||
aws cloudfront create-invalidation \
|
aws cloudfront create-invalidation \
|
||||||
--distribution-id "${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }}" \
|
--distribution-id "${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }}" \
|
||||||
--paths "/en/*" "/robots.txt" "/en/robots.txt" "/sitemap.xml" "/en/sitemap.xml"
|
--paths "/en/*" "/robots.txt" "/sitemap.xml"
|
||||||
|
|
||||||
|
|||||||
@@ -296,7 +296,9 @@ jobs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
paths=("/$BRANCH/*" "/$BRANCH/sitemap.xml")
|
# The wildcard already invalidates the language sitemap, so avoid
|
||||||
|
# paying for a redundant explicit /$BRANCH/sitemap.xml path.
|
||||||
|
paths=("/$BRANCH/*")
|
||||||
if [ "${{ steps.root_sitemap.outputs.changed }}" = "true" ]; then
|
if [ "${{ steps.root_sitemap.outputs.changed }}" = "true" ]; then
|
||||||
paths+=("/sitemap.xml")
|
paths+=("/sitemap.xml")
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user