Skip to content

Commit 0b66e95

Browse files
committed
TCLOUD-4866: Remove cache invalidation and add cache control headers
1 parent c6793da commit 0b66e95

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

.github/workflows/deploy_docs_v2.yml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ env:
2020
TARGET: ${{ inputs.environment || 'staging' }}
2121
ACCT: ${{ inputs.environment == 'production' && '990880627107' || '327995277200' }}
2222
BUCKET: ${{ inputs.environment == 'production' && 'tiny-cloud-antora-docs-release' || 'tiny-cloud-antora-docs-preview' }}
23-
DISTRIBUTION: ${{ inputs.environment == 'production' && 'E3LFU502SQ5UR' || 'E7DUUPEI08HNW'}}
2423
RUN: run-${{ github.run_number }}-${{ github.run_attempt }}
2524

2625
jobs:
@@ -66,9 +65,15 @@ jobs:
6665
role-session-name: tinymce-docs-${{ env.TARGET }}-release
6766
aws-region: us-east-1
6867

69-
- name: Upload website preview to S3
68+
- name: Upload website to S3
7069
run: |
71-
aws s3 sync ./build s3://${BUCKET}/main/${RUN}
70+
aws s3 sync ./build s3://${BUCKET}/main/${RUN} \
71+
--exclude "index.html" \
72+
--cache-control "public, max-age=3600, stale-while-revalidate=86400"
73+
aws s3 sync ./build s3://${BUCKET}/main/${RUN} \
74+
--exclude "*" \
75+
--include "index.html" \
76+
--cache-control "max-age=300, stale-while-revalidate=86400"
7277
7378
- name: Create redirects on S3
7479
uses: tinymce/[email protected]
@@ -89,9 +94,3 @@ jobs:
8994
bucket: ${{ env.BUCKET }}
9095
folder: main
9196
parallel: 20
92-
93-
- name: Invalidate Cloudfront Cache
94-
# sleep to wait for envoy's version pointer caching to expire
95-
run: |
96-
sleep 30s
97-
aws cloudfront create-invalidation --distribution-id ${{ env.DISTRIBUTION }} --paths "/docs/*"

0 commit comments

Comments
 (0)