Skip to content

Commit 851e42a

Browse files
committed
chore: storybook 배포 action 설정
1 parent 1d6865a commit 851e42a

File tree

5 files changed

+124
-0
lines changed

5 files changed

+124
-0
lines changed

.github/workflows/storybook.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: Chromatic Deployment
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- develop
7+
8+
jobs:
9+
chromatic-deployment:
10+
name: Chromatic
11+
runs-on: ubuntu-latest
12+
outputs:
13+
statis: ${{ job.status }}
14+
storybook_url: ${{ steps.chromatic.outputs.storybookUrl }}
15+
currnent_time: ${{ steps.current-time.outputs.formattedTime }}
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
22+
- name: Setup node
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: 18
26+
cache: "yarn"
27+
28+
- name: Set yarn version
29+
id: set-version
30+
run: |
31+
yarn set version 4.1.1
32+
echo "YARN_VERSION=$(yarn -v)" >> $GITHUB_OUTPUT
33+
34+
- name: Yarn cache - PnP
35+
uses: actions/cache@v4
36+
with:
37+
path: |
38+
.yarn/cache
39+
.pnp.*
40+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}-${{ steps.set-version.outputs.YARN_VERSION }}
41+
restore-keys: |
42+
${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}-
43+
44+
- name: Install dependencies
45+
run: yarn
46+
47+
- name: Publish to Chromatic
48+
id: chromatic
49+
uses: chromaui/action@latest
50+
with:
51+
exitZeroOnChanges: true
52+
autoAcceptChanges: true
53+
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
54+
55+
- name: Get current time
56+
uses: josStorer/get-current-time@v2
57+
id: current-time
58+
with:
59+
format: "YYYY년 MM월 DD일 HH시 mm분"
60+
utcOffset: "+09:00"
61+
62+
github-storybook-comment:
63+
runs-on: ubuntu-latest
64+
needs: [chromatic-deployment]
65+
steps:
66+
- name: Comment PR
67+
uses: thollander/actions-comment-pull-request@v3
68+
with:
69+
comment-tag: ${{ github.event.number }}-storybook
70+
message: |
71+
72+
🧷 Storybook: ${{ needs.chromatic-deployment.outputs.storybook_url }}
73+
74+
⏰ Update: ${{ needs.chromatic-deployment.outputs.currnent_time }}

.pnp.cjs

Lines changed: 28 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
5.3 MB
Binary file not shown.

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"lint:fix": "eslint --fix './src/**/*.{ts,tsx,js,jsx}'",
1212
"format": "prettier --write src/**/*.{ts,tsx,js,jsx}",
1313
"storybook": "storybook dev -p 6006",
14+
"build-storybook": "storybook build",
1415
"test": "jest",
1516
"cypress": "cypress open"
1617
},
@@ -41,6 +42,7 @@
4142
"@typescript-eslint/eslint-plugin": "^8.20.0",
4243
"@typescript-eslint/parser": "^8.20.0",
4344
"@vitejs/plugin-react": "^4.3.4",
45+
"chromatic": "^11.25.1",
4446
"cypress": "^14.0.0",
4547
"eslint": "^8.57.0",
4648
"eslint-config-prettier": "^10.0.1",

yarn.lock

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3648,6 +3648,25 @@ __metadata:
36483648
languageName: node
36493649
linkType: hard
36503650

3651+
"chromatic@npm:^11.25.1":
3652+
version: 11.25.1
3653+
resolution: "chromatic@npm:11.25.1"
3654+
peerDependencies:
3655+
"@chromatic-com/cypress": ^0.*.* || ^1.0.0
3656+
"@chromatic-com/playwright": ^0.*.* || ^1.0.0
3657+
peerDependenciesMeta:
3658+
"@chromatic-com/cypress":
3659+
optional: true
3660+
"@chromatic-com/playwright":
3661+
optional: true
3662+
bin:
3663+
chroma: dist/bin.js
3664+
chromatic: dist/bin.js
3665+
chromatic-cli: dist/bin.js
3666+
checksum: 10c0/869939cf65ddc4c606ac982cbbaba63d3d6cbc8082e24f04f74ee6a5e3979cdec49e8fab2549f87e8cfa8127c15dbda1f86371306642bdabcb43ee9cff46ceae
3667+
languageName: node
3668+
linkType: hard
3669+
36513670
"ci-info@npm:^3.2.0":
36523671
version: 3.9.0
36533672
resolution: "ci-info@npm:3.9.0"
@@ -7778,6 +7797,7 @@ __metadata:
77787797
"@typescript-eslint/eslint-plugin": "npm:^8.20.0"
77797798
"@typescript-eslint/parser": "npm:^8.20.0"
77807799
"@vitejs/plugin-react": "npm:^4.3.4"
7800+
chromatic: "npm:^11.25.1"
77817801
classnames: "npm:^2.5.1"
77827802
cypress: "npm:^14.0.0"
77837803
eslint: "npm:^8.57.0"

0 commit comments

Comments
 (0)