-
Notifications
You must be signed in to change notification settings - Fork 3
82 lines (71 loc) · 2.16 KB
/
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: Optimized Preview
on:
pull_request:
branches: ["main", "develop"]
paths:
- "frontend/**"
permissions:
contents: read
pages: write
id-token: write
pull-requests: write
jobs:
storybook-preview:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20.11.1"
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- name: Cache yarn dependencies
uses: actions/cache@v3
id: yarn-cache
with:
path: |
${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('frontend/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: |
cd frontend
yarn install --prefer-offline --frozen-lockfile
- name: Build Storybook
run: |
cd frontend
yarn build-storybook
- name: Publish to Chromatic
uses: chromaui/action@v1
id: publish-to-chromatic # id 추가
with:
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
token: ${{ secrets.GITHUB_TOKEN }}
workingDir: frontend
storybookBuildDir: storybook-static
onlyChanged: true
exitZeroOnChanges: true
- name: Get current time
uses: josStorer/get-current-time@v2
id: current-time
with:
format: "YYYY년 MM월 DD일 HH시 mm분 ss초"
utcOffset: "+09:00"
outputs:
storybook_url: ${{ steps.publish-to-chromatic.outputs.storybookUrl }}
github-bot-storybook:
needs: [storybook-preview]
runs-on: ubuntu-latest
steps:
- name: Comment on PR
uses: thollander/actions-comment-pull-request@v2
with:
comment_tag: ${{github.event.number}}-storybook
message: |
💄 Storybook: ${{ needs.storybook-preview.outputs.storybook_url }} # 출력된 URL 참조