Skip to content

Commit

Permalink
fix: update build-staging-deploy-s3.yml to delete everything other th…
Browse files Browse the repository at this point in the history
…an previos and current build in the bucket
  • Loading branch information
syam babu committed Oct 18, 2024
1 parent 9e99dc0 commit 2698e2b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .github/workflows/build-staging-deploy-s3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,7 @@ jobs:
if [ "$previous_major_version" -ge 0 ]; then
aws s3 rm s3://${{env.WEBHOSTING_BUCKET_NAME}}/v${previous_major_version}/ --recursive || true
fi
fi
# Delete everything else in the bucket except the current and previous major version folders
aws s3 ls s3://${{env.WEBHOSTING_BUCKET_NAME}}/ | grep -vE "v${major_version}/|v${previous_major_version}/" | awk '{print $2}' | xargs -I {} aws s3 rm s3://${{env.WEBHOSTING_BUCKET_NAME}}/{}

0 comments on commit 2698e2b

Please sign in to comment.