Skip to content

Commit c80af13

Browse files
authored
more cache busting (#115)
1 parent a8da0c4 commit c80af13

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

.github/workflows/deploy.yml

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ jobs:
2525
run: |
2626
npm ci
2727
npm install @angular/cli > /dev/null
28-
npx ng build
28+
# Ensure consistent output hashing for runtime files
29+
npx ng build --output-hashing=bundles
2930
3031
- name: Deploy Main Site
3132
uses: JamesIves/github-pages-deploy-action@v4.7.3
@@ -41,7 +42,14 @@ jobs:
4142
AWS_REGION: us-east-1
4243
if: github.ref == 'refs/heads/main'
4344
run: |
44-
aws s3 sync --delete ./dist s3://${{ secrets.AWS_PROD_BUCKET }}
45+
# Deploy HTML files with no-cache to prevent stale references
46+
aws s3 sync --delete ./dist s3://${{ secrets.AWS_PROD_BUCKET }} \
47+
--exclude "*" --include "*.html" \
48+
--cache-control "no-cache, no-store, must-revalidate"
49+
50+
# Deploy all other files normally
51+
aws s3 sync ./dist s3://${{ secrets.AWS_PROD_BUCKET }} \
52+
--exclude "*.html"
4553
4654
- name: Deploy S3 Staging
4755
env:
@@ -50,4 +58,11 @@ jobs:
5058
AWS_REGION: us-east-1
5159
if: github.ref == 'refs/heads/develop'
5260
run: |
53-
aws s3 sync --delete ./dist s3://${{ secrets.AWS_STAGING_BUCKET }}
61+
# Deploy HTML files with no-cache to prevent stale references
62+
aws s3 sync --delete ./dist s3://${{ secrets.AWS_STAGING_BUCKET }} \
63+
--exclude "*" --include "*.html" \
64+
--cache-control "no-cache, no-store, must-revalidate"
65+
66+
# Deploy all other files normally
67+
aws s3 sync ./dist s3://${{ secrets.AWS_STAGING_BUCKET }} \
68+
--exclude "*.html"

0 commit comments

Comments
 (0)