From 234bd832299334cb6e007251a243f7db3f21750b Mon Sep 17 00:00:00 2001 From: Carlos Polop Date: Wed, 11 Mar 2026 21:34:12 +0100 Subject: [PATCH] Invalidate SEO deploys and fix translation script path --- .github/workflows/build_master.yml | 6 ++++++ .github/workflows/translate_all.yml | 11 +++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_master.yml b/.github/workflows/build_master.yml index b0d92e7ea..f036ff2ce 100644 --- a/.github/workflows/build_master.yml +++ b/.github/workflows/build_master.yml @@ -176,4 +176,10 @@ jobs: run: | aws s3 cp ./src/robots.txt s3://hacktricks-cloud/robots.txt --content-type text/plain --cache-control max-age=300 aws s3 cp ./src/robots.txt s3://hacktricks-cloud/en/robots.txt --content-type text/plain --cache-control max-age=300 + + - name: Invalidate CloudFront HTML and SEO assets + run: | + aws cloudfront create-invalidation \ + --distribution-id "${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }}" \ + --paths "/en/*" "/robots.txt" "/en/robots.txt" "/sitemap.xml" "/en/sitemap.xml" diff --git a/.github/workflows/translate_all.yml b/.github/workflows/translate_all.yml index 49bd5d363..ec811c142 100644 --- a/.github/workflows/translate_all.yml +++ b/.github/workflows/translate_all.yml @@ -82,6 +82,7 @@ jobs: wget -O /tmp/get_and_save_refs.py https://raw.githubusercontent.com/HackTricks-wiki/hacktricks-cloud/master/scripts/get_and_save_refs.py wget -O /tmp/compare_and_fix_refs.py https://raw.githubusercontent.com/HackTricks-wiki/hacktricks-cloud/master/scripts/compare_and_fix_refs.py wget -O /tmp/translator.py https://raw.githubusercontent.com/HackTricks-wiki/hacktricks-cloud/master/scripts/translator.py + wget -O /tmp/seo_postprocess.py https://raw.githubusercontent.com/HackTricks-wiki/hacktricks-cloud/master/scripts/seo_postprocess.py - name: Run get_and_save_refs.py run: | @@ -257,7 +258,7 @@ jobs: - name: Post-process SEO artifacts run: | - python3 scripts/seo_postprocess.py pages \ + python3 /tmp/seo_postprocess.py pages \ --book-dir ./book \ --site-url https://cloud.hacktricks.wiki \ --lang "$BRANCH" \ @@ -281,5 +282,11 @@ jobs: if [ -z "$LANGS" ]; then LANGS="en" fi - python3 scripts/seo_postprocess.py index --site-url https://cloud.hacktricks.wiki --languages "$LANGS" --output ./sitemap.xml + python3 /tmp/seo_postprocess.py index --site-url https://cloud.hacktricks.wiki --languages "$LANGS" --output ./sitemap.xml aws s3 cp ./sitemap.xml s3://hacktricks-cloud/sitemap.xml --content-type application/xml --cache-control max-age=300 + + - name: Invalidate CloudFront HTML and SEO assets + run: | + aws cloudfront create-invalidation \ + --distribution-id "${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }}" \ + --paths "/$BRANCH/*" "/robots.txt" "/sitemap.xml" "/$BRANCH/sitemap.xml"