-
Notifications
You must be signed in to change notification settings - Fork 90
56 lines (54 loc) · 1.81 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: "Build Storybook"
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened, labeled]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-storybook:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "yarn"
- name: Install dependencies
run: yarn
- name: Build Storybook
run: yarn build-storybook
env:
NODE_OPTIONS: "--max_old_space_size=6144"
- name: Upload Storybook Static
uses: actions/upload-artifact@v4
with:
name: storybook-build
path: ./storybook-static
retention-days: 1
- name: Save branch metadata for Chromatic
run: |
mkdir METADATA
echo $BRANCH_NAME > ./METADATA/branch-name
echo $DRAFT > ./METADATA/draft
echo $BASE > ./METADATA/base
echo $RUN_CHROMATIC > ./METADATA/run-chromatic
echo $NO_TURBOSNAP > ./METADATA/no-turbosnap
echo $ISSUE_NUMBER > ./METADATA/issue-number
env:
DRAFT: ${{ github.event.pull_request.draft }}
BRANCH_NAME: ${{ github.event.pull_request.head.label || github.ref_name }}
BASE: ${{ github.event.pull_request.base.ref || github.ref_name }}
RUN_CHROMATIC: ${{ contains(github.event.pull_request.labels.*.name, 'chromatic') }}
NO_TURBOSNAP: ${{ contains(github.event.pull_request.labels.*.name, 'no turbosnap') }}
ISSUE_NUMBER: ${{ github.event.pull_request.number }}
- uses: actions/upload-artifact@v4
with:
name: metadata
path: ./METADATA
retention-days: 1