mirror of
https://github.com/HackTricks-wiki/hacktricks-cloud.git
synced 2026-07-28 14:47:17 -07:00
ci: avoid redundant S3 uploads (#326)
Co-authored-by: Hermes Agent <hermes-agent@users.noreply.github.com>
This commit is contained in:
co-authored by
Hermes Agent
parent
a2c70780d3
commit
7e5ea5c1f8
@@ -84,6 +84,7 @@ jobs:
|
||||
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
|
||||
cp scripts/mark_unchanged_s3_files.py /tmp/mark_unchanged_s3_files.py
|
||||
|
||||
- name: Run get_and_save_refs.py
|
||||
run: |
|
||||
@@ -272,6 +273,16 @@ jobs:
|
||||
echo "Current branch:"
|
||||
git rev-parse --abbrev-ref HEAD
|
||||
echo "Syncing $BRANCH to S3"
|
||||
# mdBook refreshes mtimes on every build. Age byte-identical files
|
||||
# based on single-part S3 ETags so `s3 sync` skips redundant PUTs.
|
||||
aws s3api list-objects-v2 \
|
||||
--bucket hacktricks-cloud \
|
||||
--prefix "$BRANCH/" \
|
||||
--output json > /tmp/s3-branch-manifest.json
|
||||
python3 /tmp/mark_unchanged_s3_files.py \
|
||||
--source ./book \
|
||||
--manifest /tmp/s3-branch-manifest.json \
|
||||
--remote-prefix "$BRANCH/"
|
||||
aws s3 sync ./book s3://hacktricks-cloud/$BRANCH --delete
|
||||
echo "Sync completed"
|
||||
echo "Cat 3 files from the book"
|
||||
|
||||
Reference in New Issue
Block a user