Skip to content

Commit

Permalink
fix: artifacts.yml action
Browse files Browse the repository at this point in the history
  • Loading branch information
mrekucci committed Aug 1, 2024
1 parent 11e33f9 commit c4bf67c
Showing 1 changed file with 4 additions and 16 deletions.
20 changes: 4 additions & 16 deletions .github/workflows/artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,19 +99,7 @@ jobs:

- name: Upload Artifacts to AWS S3
run: |
aws s3 cp ./dist/ s3://${{ secrets.AWS_S3_BUCKET }} \
--recursive \
--exclude "*" \
--include "*.gz" \
--include "*.txt" \
- name: Set Artifacts Retention
if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
run: |
ls -1 ./dist | grep '\.gz\|\.txt$' | while read -r file; do
echo "Tagging uploaded file $file for auto delete"
aws s3api put-object-tagging \
--bucket ${{ secrets.AWS_S3_BUCKET }} \
--key "$file" \
--tagging 'TagSet=[{Key=AutoDelete,Value=true}]'
done
find /tmp/dist \
-type f \( -name "*.gz" -o -name "*.txt" \) \
-exec aws s3 cp {} s3://${{ secrets.AWS_S3_BUCKET }}/ \; \
-exec aws s3api put-object-tagging --bucket ${{ secrets.AWS_S3_BUCKET }} --key $(basename {}) --tagging 'TagSet=[{Key=AutoDelete,Value=true}]' \;

0 comments on commit c4bf67c

Please sign in to comment.