Skip to content

Commit

Permalink
OPHJOD-1065: Update S3 sync paths and CloudFront cache invalidation
Browse files Browse the repository at this point in the history
  • Loading branch information
sauanto committed Dec 3, 2024
1 parent 930afcc commit d46dd82
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and deploy JOD Yksilö UI
name: Build
on:
workflow_dispatch:
push:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: deploy
name: Deploy
on:
workflow_call:
inputs:
Expand Down Expand Up @@ -47,8 +47,8 @@ jobs:

- name: Copy files to S3
run: |
aws s3 sync --size-only --delete --cache-control "public,max-age=31536000,immutable" assets/ s3://${{ secrets.JOD_AWS_DIST_BUCKET }}/assets
aws s3 sync --exclude "assets/*" --delete --cache-control "public,max-age=0,s-maxage=60,must-revalidate" . s3://${{ secrets.JOD_AWS_DIST_BUCKET }}
aws s3 sync --size-only --delete --cache-control "public,max-age=31536000,immutable" assets/ s3://${{ secrets.JOD_AWS_DIST_BUCKET }}/yksilo/assets
aws s3 sync --exclude "assets/*" --delete --cache-control "public,max-age=0,s-maxage=60,must-revalidate" . s3://${{ secrets.JOD_AWS_DIST_BUCKET }}/yksilo
- name: Invalidate cache for index.html on deploy
run: aws cloudfront create-invalidation --distribution-id ${{ secrets.JOD_AWS_CLOUDFRONT_ID }} --paths '/index.html'
run: aws cloudfront create-invalidation --distribution-id ${{ secrets.JOD_AWS_CLOUDFRONT_ID }} --paths '/yksilo/index.html'

0 comments on commit d46dd82

Please sign in to comment.