99 - ' package.json'
1010 workflow_dispatch :
1111
12- permissions :
13- contents : read
14- pages : write
15- id-token : write
16-
17- concurrency :
18- group : ' pages'
19- cancel-in-progress : false
20-
2112jobs :
22- build :
13+ build-and-deploy :
2314 runs-on : ubuntu-latest
2415 steps :
2516 - name : Checkout
@@ -33,33 +24,34 @@ jobs:
3324 with :
3425 node-version : 22
3526
36- - name : Setup pnpm
37- run : npm install -g pnpm
27+ - name : Setup Yarn
28+ run : npm install -g yarn
3829
3930 - name : Install Dependencies
40- run : pnpm install --frozen-lockfile
41-
42- - name : Build Stencil components
43- run : pnpm run build
44-
45- - name : Build Storybook
46- run : pnpm run storybook-build
31+ run : yarn install --frozen-lockfile
4732
48- - name : Setup Pages
49- uses : actions/configure-pages@v4
33+ - name : Build Storybook (includes Stencil build)
34+ run : yarn run storybook-build
5035
51- - name : Upload artifact
52- uses : actions/upload-pages-artifact@v3
36+ - name : Configure AWS Credentials
37+ uses : aws- actions/configure-aws-credentials@v4
5338 with :
54- path : ./storybook-static
55-
56- deploy :
57- environment :
58- name : github-pages
59- url : ${{ steps.deployment.outputs.page_url }}
60- runs-on : ubuntu-latest
61- needs : build
62- steps :
63- - name : Deploy to GitHub Pages
64- id : deployment
65- uses : actions/deploy-pages@v4
39+ aws-access-key-id : ${{ secrets.AWS_ACCESS_KEY_ID }}
40+ aws-secret-access-key : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
41+ aws-region : ' us-east-1'
42+
43+ - name : Deploy to S3 bucket
44+ run : aws s3 sync ./storybook-static/ s3://${{ secrets.AWS_S3_BUCKET }} --delete
45+
46+ - name : No-cache index.html
47+ 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
48+
49+ - name : Slack Notification
50+ uses : rtCamp/action-slack-notify@master
51+ env :
52+ SLACK_ICON_EMOJI : ' :books:'
53+ SLACK_USERNAME : mx-sdk-dapp-ui
54+ SLACK_MESSAGE : ' Storybook deployed to ${{ secrets.AWS_S3_BUCKET }}'
55+ SLACK_FOOTER : ' '
56+ MSG_MINIMAL : true
57+ SLACK_WEBHOOK : ${{ secrets.SLACK_WEBHOOK }}
0 commit comments