Skip to content

Commit 32e1598

Browse files
Fixed workflow build
1 parent ab7ba12 commit 32e1598

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

.github/workflows/deploy-storybook.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,16 @@ jobs:
4444
- name: Deploy to S3 bucket
4545
run: aws s3 sync ./storybook-static/ s3://${{ secrets.AWS_S3_BUCKET }} --delete --acl public-read
4646

47-
- name: Set proper MIME types for JS files
47+
- name: Set proper MIME types and headers for all files
4848
run: |
49-
aws s3 cp s3://${{ secrets.AWS_S3_BUCKET }}/ s3://${{ secrets.AWS_S3_BUCKET }}/ --recursive --exclude "*" --include "*.js" --content-type "application/javascript" --metadata-directive REPLACE --acl public-read
50-
aws s3 cp s3://${{ secrets.AWS_S3_BUCKET }}/ s3://${{ secrets.AWS_S3_BUCKET }}/ --recursive --exclude "*" --include "*.css" --content-type "text/css" --metadata-directive REPLACE --acl public-read
49+
# JavaScript files with proper CORS
50+
aws s3 cp s3://${{ secrets.AWS_S3_BUCKET }}/ s3://${{ secrets.AWS_S3_BUCKET }}/ --recursive --exclude "*" --include "*.js" --content-type "application/javascript" --metadata-directive REPLACE --acl public-read --cache-control "public, max-age=31536000"
51+
# CSS files
52+
aws s3 cp s3://${{ secrets.AWS_S3_BUCKET }}/ s3://${{ secrets.AWS_S3_BUCKET }}/ --recursive --exclude "*" --include "*.css" --content-type "text/css" --metadata-directive REPLACE --acl public-read --cache-control "public, max-age=31536000"
53+
# JSON files
5154
aws s3 cp s3://${{ secrets.AWS_S3_BUCKET }}/ s3://${{ secrets.AWS_S3_BUCKET }}/ --recursive --exclude "*" --include "*.json" --content-type "application/json" --metadata-directive REPLACE --acl public-read
55+
# HTML files (iframe.html, etc.)
56+
aws s3 cp s3://${{ secrets.AWS_S3_BUCKET }}/ s3://${{ secrets.AWS_S3_BUCKET }}/ --recursive --exclude "*" --include "*.html" --content-type "text/html" --metadata-directive REPLACE --acl public-read --cache-control "no-cache"
5257
5358
- name: No-cache index.html
5459
run: aws s3 cp s3://${{ secrets.AWS_S3_BUCKET }}/index.html s3://${{ secrets.AWS_S3_BUCKET }}/index.html --metadata-directive REPLACE --cache-control max-age=0,no-cache,no-store,must-revalidate --content-type text/html --acl public-read
@@ -58,8 +63,8 @@ jobs:
5863
env:
5964
SLACK_ICON_EMOJI: ':books:'
6065
SLACK_USERNAME: mx-sdk-dapp-ui
61-
SLACK_TITLE: 'Storybook Deployment'
62-
SLACK_MESSAGE: 'Storybook successfully deployed to https://${{ secrets.AWS_S3_BUCKET }}.s3.amazonaws.com'
66+
SLACK_TITLE: 'Storybook'
67+
SLACK_MESSAGE: 'Successfully deployed to ${{ secrets.AWS_S3_BUCKET }}'
6368
SLACK_COLOR: 'good'
6469
SLACK_FOOTER: 'Deployed from branch: ${{ github.ref_name }}'
6570
MSG_MINIMAL: false

0 commit comments

Comments
 (0)