Skip to content

Commit 025b8ef

Browse files
committed
delete temporary files
1 parent a3146da commit 025b8ef

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

.github/workflows/deploy-production.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,14 @@ jobs:
8282
# Don't cache any HTML or JSON file: they should always be up-to-dates
8383
run: aws s3 sync --cache-control "public, max-age=0, must-revalidate" --include "*.html" --include="sw.js" --include="*.json" --include "*.css" --exclude="*.js" --exclude="*.gif" --exclude="*.png" --exclude="*.svg" --exclude="*.pdf" --delete public/ s3://${{ secrets.PRODUCTION_BUCKET_NAME }}/
8484

85+
- name: Create temporary directory
86+
run: mkdir -p /tmp/aws-sync-temp
87+
88+
- name: Copy files to temporary directory
89+
run: cp -r public/*.pdf /tmp/aws-sync-temp/
90+
8591
- name: Sync PDF
86-
run: aws s3 sync --cache-control "public, max-age=86400, must-revalidate" --include "*.pdf" --exclude="*.js" --exclude="*.gif" --exclude="*.png" --exclude="*.svg" --exclude="*.css" --exclude="*.html" --exclude="*.json" --exclude="sw.json" --delete public/ s3://${{ secrets.PRODUCTION_BUCKET_NAME }}/ --temp-dir /tmp/aws-sync-temp
92+
run: aws s3 sync --cache-control "public, max-age=86400, must-revalidate" /tmp/aws-sync-temp/ s3://${{ secrets.PRODUCTION_BUCKET_NAME }}/ --exclude "*.js" --exclude "*.gif" --exclude "*.png" --exclude "*.svg" --exclude "*.css" --exclude "*.html" --exclude "*.json" --exclude "sw.json" --delete
8793

8894
- name: Cleanup temporary files
8995
run: rm -rf /tmp/aws-sync-temp

.github/workflows/deploy-staging.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,14 @@ jobs:
8181
# Don't cache any HTML or JSON file: they should always be up-to-dates
8282
run: aws s3 sync --cache-control "public, max-age=0, must-revalidate" --include "*.html" --include="sw.js" --include="*.json" --include "*.css" --exclude="*.js" --exclude="*.gif" --exclude="*.png" --exclude="*.svg" --exclude="*.pdf" --delete public/ s3://${{ secrets.STAGING_BUCKET_NAME }}/
8383

84+
- name: Create temporary directory
85+
run: mkdir -p /tmp/aws-sync-temp
86+
87+
- name: Copy files to temporary directory
88+
run: cp -r public/*.pdf /tmp/aws-sync-temp/
89+
8490
- name: Sync PDF
85-
run: aws s3 sync --cache-control "public, max-age=86400, must-revalidate" --include "*.pdf" --exclude="*.js" --exclude="*.gif" --exclude="*.png" --exclude="*.svg" --exclude="*.css" --exclude="*.html" --exclude="*.json" --exclude="sw.json" --delete public/ s3://${{ secrets.STAGING_BUCKET_NAME }}/ --temp-dir /tmp/aws-sync-temp
91+
run: aws s3 sync --cache-control "public, max-age=86400, must-revalidate" /tmp/aws-sync-temp/ s3://${{ secrets.STAGING_BUCKET_NAME }}/ --exclude "*.js" --exclude "*.gif" --exclude "*.png" --exclude "*.svg" --exclude "*.css" --exclude "*.html" --exclude "*.json" --exclude "sw.json" --delete
8692

8793
- name: Cleanup temporary files
8894
run: rm -rf /tmp/aws-sync-temp

0 commit comments

Comments
 (0)