Skip to content

Commit 2e90336

Browse files
committed
undo purge cache
1 parent 5f3b441 commit 2e90336

File tree

2 files changed

+34
-19
lines changed

2 files changed

+34
-19
lines changed

.github/workflows/deploy-production.yml

+15-8
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,19 @@ 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: 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 }}/
85+
# - 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 }}/
8787

88-
- name: Purge cache on CloudFlare
89-
run: |
90-
curl -X POST "https://api.cloudflare.com/client/v4/zones/${{ secrets.CLOUDFLARE_ZONE }}/purge_cache" \
91-
-H "Authorization: Bearer ${{ secrets.CLOUDFLARE_PURGE_API_TOKEN }}" \
92-
-H "Content-Type: application/json" \
93-
--data '{"prefixes":["${{ vars.DATASHEETS_BASE_URL }}"]}'
88+
# - name: Purge cache on CloudFlare
89+
# run: |
90+
# curl -X POST "https://api.cloudflare.com/client/v4/zones/${{ secrets.CLOUDFLARE_ZONE }}/purge_cache" \
91+
# -H "Authorization: Bearer ${{ secrets.CLOUDFLARE_PURGE_API_TOKEN }}" \
92+
# -H "Content-Type: application/json" \
93+
# --data '{"prefixes":["${{ vars.DATASHEETS_BASE_URL }}"]}'
94+
95+
- name: Sync all cacheable assets
96+
run: aws s3 sync --cache-control "public, max-age=31536000, immutable" --include "*.css" --include="*.js" --include="*.gif" --include="*.png" --include="*.svg" --exclude "*.html" --exclude="sw.js" --exclude="*.json" --delete public/ s3://${{ secrets.PRODUCTION_BUCKET_NAME }}/
97+
98+
- name: Sync all non-cacheable assets
99+
# Don't cache any HTML or JSON file: they should always be up-to-dates
100+
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" --delete public/ s3://${{ secrets.PRODUCTION_BUCKET_NAME }}/

.github/workflows/deploy-staging.yml

+19-11
Original file line numberDiff line numberDiff line change
@@ -74,19 +74,27 @@ jobs:
7474
role-to-assume: ${{ secrets.STAGING_IAM_ROLE }}
7575
aws-region: us-east-1
7676

77+
# - name: Sync all cacheable assets
78+
# run: aws s3 sync --cache-control "public, max-age=31536000, immutable" --include "*.css" --include="*.js" --include="*.gif" --include="*.png" --include="*.svg" --exclude "*.html" --exclude="sw.js" --exclude="*.json" --exclude="*.pdf" --delete public/ s3://${{ secrets.STAGING_BUCKET_NAME }}/
79+
80+
# - name: Sync all non-cacheable assets
81+
# # Don't cache any HTML or JSON file: they should always be up-to-dates
82+
# 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 }}/
83+
84+
# - 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 }}/
86+
87+
# - name: Purge cache on CloudFlare
88+
# run: |
89+
# curl -X POST "https://api.cloudflare.com/client/v4/zones/${{ secrets.CLOUDFLARE_ZONE }}/purge_cache" \
90+
# -H "Authorization: Bearer ${{ secrets.CLOUDFLARE_PURGE_API_TOKEN }}" \
91+
# -H "Content-Type: application/json" \
92+
# --data '{"prefixes":["${{ vars.DATASHEETS_BASE_URL }}"]}'
93+
7794
- name: Sync all cacheable assets
78-
run: aws s3 sync --cache-control "public, max-age=31536000, immutable" --include "*.css" --include="*.js" --include="*.gif" --include="*.png" --include="*.svg" --exclude "*.html" --exclude="sw.js" --exclude="*.json" --exclude="*.pdf" --delete public/ s3://${{ secrets.STAGING_BUCKET_NAME }}/
95+
run: aws s3 sync --cache-control "public, max-age=31536000, immutable" --include "*.css" --include="*.js" --include="*.gif" --include="*.png" --include="*.svg" --exclude "*.html" --exclude="sw.js" --exclude="*.json" --delete public/ s3://${{ secrets.STAGING_BUCKET_NAME }}/
7996

8097
- name: Sync all non-cacheable assets
8198
# Don't cache any HTML or JSON file: they should always be up-to-dates
82-
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 }}/
83-
84-
- 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 }}/
99+
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" --delete public/ s3://${{ secrets.STAGING_BUCKET_NAME }}/
86100

87-
- name: Purge cache on CloudFlare
88-
run: |
89-
curl -X POST "https://api.cloudflare.com/client/v4/zones/${{ secrets.CLOUDFLARE_ZONE }}/purge_cache" \
90-
-H "Authorization: Bearer ${{ secrets.CLOUDFLARE_PURGE_API_TOKEN }}" \
91-
-H "Content-Type: application/json" \
92-
--data '{"prefixes":["${{ vars.DATASHEETS_BASE_URL }}"]}'

0 commit comments

Comments
 (0)