Skip to content

Commit ff75900

Browse files
chore: updates to actions
1 parent 5503f1d commit ff75900

File tree

2 files changed

+65
-0
lines changed

2 files changed

+65
-0
lines changed
+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Deploy Main Storybook
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
jobs:
10+
build-and-deploy:
11+
name: Build and Deploy Main Storybook
12+
runs-on: ubuntu-latest
13+
permissions:
14+
contents: write
15+
environment: github-pages
16+
defaults:
17+
run:
18+
working-directory: apps/storybook-react
19+
steps:
20+
- name: Checkout and setup high risk environment
21+
uses: MetaMask/action-checkout-and-setup@v1
22+
with:
23+
is-high-risk-environment: true
24+
skip-allow-scripts: true
25+
26+
- name: Build storybook
27+
run: yarn build-storybook
28+
29+
- name: Deploy to GitHub Pages
30+
uses: peaceiris/actions-gh-pages@de7ea6f8efb354206b205ef54722213d99067935
31+
with:
32+
github_token: ${{ secrets.GITHUB_TOKEN }}
33+
publish_dir: apps/storybook-react/storybook-static
34+
destination_dir: storybook
+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Build Storybook PR
2+
3+
on:
4+
pull_request:
5+
workflow_dispatch:
6+
7+
jobs:
8+
build-storybook:
9+
name: Build Storybook PR
10+
runs-on: ubuntu-latest
11+
defaults:
12+
run:
13+
working-directory: apps/storybook-react
14+
steps:
15+
- name: Checkout and setup high risk environment
16+
uses: MetaMask/action-checkout-and-setup@v1
17+
with:
18+
is-high-risk-environment: true
19+
skip-allow-scripts: true
20+
21+
- name: Build storybook
22+
run: yarn build-storybook
23+
24+
- name: Upload 'storybook-build' to S3
25+
if: ${{ vars.AWS_REGION && vars.AWS_IAM_ROLE && vars.AWS_S3_BUCKET }}
26+
uses: metamask/github-tools/.github/actions/upload-s3@1233659b3850eb84824d7375e2e0c58eb237701d
27+
with:
28+
aws-region: ${{ vars.AWS_REGION }}
29+
role-to-assume: ${{ vars.AWS_IAM_ROLE }}
30+
s3-bucket: ${{ vars.AWS_S3_BUCKET }}/${{ github.event.repository.name }}/${{ github.event.pull_request.number }}/storybook-build
31+
path: apps/storybook-react/storybook-static

0 commit comments

Comments
 (0)