Skip to content

Commit 5b7bb89

Browse files
committed
feat: add S3 route fixing step in web-sync workflow
1 parent 999f746 commit 5b7bb89

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

.github/workflows/web-sync.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,16 @@ jobs:
3939
- name: "Sync with AWS S3"
4040
run: aws s3 sync ./frontend/out/ s3://${{ secrets.AWS_SPOTLAKE_S3_BUCKET_NAME }} --acl public-read --delete
4141

42+
- name: Fix routes
43+
run: |
44+
export S3_BUCKET=${{ secrets.AWS_SPOTLAKE_S3_BUCKET_NAME }}
45+
find ./frontend/out -type f -name '*.html' | while read HTMLFILE; do
46+
BASENAME=${HTMLFILE##*/};
47+
FILENAME=${BASENAME%.*};
48+
if [[ "$FILENAME" != "index" ]]; then
49+
aws s3 cp s3://${S3_BUCKET}/${BASENAME} s3://${S3_BUCKET}/${FILENAME} --acl public-read;
50+
fi
51+
done
52+
4253
- name: "Create Invalidation"
4354
run: aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_SPOTLAKE_CLOUDFRONT_DISTRIBUTION_ID }} --paths "/*"

0 commit comments

Comments
 (0)