-
Notifications
You must be signed in to change notification settings - Fork 5k
37 lines (31 loc) · 1.21 KB
/
build-storybook.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
name: Build storybook
on:
workflow_call:
secrets:
STORYBOOK_TOKEN:
required: true
jobs:
build-storybook:
name: Build storybook
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup environment
uses: metamask/github-tools/.github/actions/setup-environment@main
- name: Build storybook
run: yarn storybook:build
- name: Upload 'storybook-build' to S3
uses: metamask/github-tools/.github/actions/upload-s3@1233659b3850eb84824d7375e2e0c58eb237701d
with:
aws-region: ${{ vars.AWS_REGION }}
role-to-assume: ${{ vars.AWS_IAM_ROLE }}
s3-bucket: ${{ vars.AWS_S3_BUCKET }}/${{ github.event.repository.name }}/${{ github.run_id }}/storybook-build
path: storybook-build
- name: Deploy storybook
# For a `pull_request` event, the branch is `github.head_ref``.
# For a `push` event, the branch is `github.ref_name`.
if: ${{ (github.head_ref || github.ref_name) == 'main' }}
run: |
git remote add storybook https://${{ secrets.STORYBOOK_TOKEN }}@github.com/MetaMask/metamask-storybook.git
yarn storybook:deploy