-
Notifications
You must be signed in to change notification settings - Fork 1
74 lines (63 loc) · 1.97 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
name: Chromatic Deployment
on:
pull_request:
branches:
- develop
jobs:
chromatic-deployment:
name: Chromatic
runs-on: ubuntu-latest
outputs:
statis: ${{ job.status }}
storybook_url: ${{ steps.chromatic.outputs.storybookUrl }}
currnent_time: ${{ steps.current-time.outputs.formattedTime }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 18
cache: "yarn"
- name: Set yarn version
id: set-version
run: |
yarn set version 4.1.1
echo "YARN_VERSION=$(yarn -v)" >> $GITHUB_OUTPUT
- name: Yarn cache - PnP
uses: actions/cache@v4
with:
path: |
.yarn/cache
.pnp.*
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}-${{ steps.set-version.outputs.YARN_VERSION }}
restore-keys: |
${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}-
- name: Install dependencies
run: yarn
- name: Publish to Chromatic
id: chromatic
uses: chromaui/action@latest
with:
exitZeroOnChanges: true
autoAcceptChanges: true
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
- name: Get current time
uses: josStorer/get-current-time@v2
id: current-time
with:
format: "YYYY년 MM월 DD일 HH시 mm분"
utcOffset: "+09:00"
github-storybook-comment:
runs-on: ubuntu-latest
needs: [chromatic-deployment]
steps:
- name: Comment PR
uses: thollander/actions-comment-pull-request@v3
with:
comment-tag: ${{ github.event.number }}-storybook
message: |
🧷 Storybook: ${{ needs.chromatic-deployment.outputs.storybook_url }}
⏰ Update: ${{ needs.chromatic-deployment.outputs.currnent_time }}