Skip to content

Commit 185dd63

Browse files
committed
refactor: chromatic action yml fix (#172)
1 parent d0b0f4f commit 185dd63

File tree

1 file changed

+45
-8
lines changed

1 file changed

+45
-8
lines changed

.github/workflows/chromatic.yml

Lines changed: 45 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ on:
44
pull_request:
55
branches:
66
- develop
7-
paths:
8-
- "**.stories.ts"
9-
- "**.stories.tsx"
10-
- "**.mdx"
7+
# paths:
8+
# - "**.stories.ts"
9+
# - "**.stories.tsx"
10+
# - "**.mdx"
1111

1212
jobs:
1313
chromatic-deployment:
@@ -21,8 +21,19 @@ jobs:
2121
with:
2222
fetch-depth: 0
2323

24-
- name: Install dependencies
25-
run: yarn
24+
- name: 캐시 종속성
25+
id: cache
26+
uses: actions/cache@v3
27+
with:
28+
path: "**/node_modules"
29+
key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }}-storybook
30+
31+
- name: 종속성 설치
32+
if: steps.cache.outputs.cache-hit != 'true'
33+
run: yarn install
34+
35+
# - name: Install dependencies
36+
# run: yarn
2637

2738
- name: Publish to Chromatic
2839
id: chromatic
@@ -33,9 +44,35 @@ jobs:
3344
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
3445
token: ${{ secrets.TOKEN }}
3546

36-
- name: comment PR
47+
- name: 현재 시간 가져오기
48+
uses: josStorer/get-current-time@v2
49+
id: current-time
50+
with:
51+
format: "YYYY년 MM월 DD일 HH시 mm분 ss초"
52+
utcOffset: "+09:00"
53+
54+
# - name: comment PR
55+
# uses: thollander/actions-comment-pull-request@v3
56+
# env:
57+
# GITHUB_TOKEN: ${{ secrets.TOKEN }}
58+
# with:
59+
# message: "storybook: ${{ steps.chromatic.outputs.storybookUrl }}"
60+
61+
outputs:
62+
storybook_url: ${{ steps.chromatic.outputs.storybookUrl }}
63+
currnent_time: ${{ steps.current-time.outputs.formattedTime }}
64+
65+
github-bot-storybook:
66+
runs-on: ubuntu-latest
67+
needs: [chromatic-deployment]
68+
steps:
69+
- name: PR 코멘트 남기기
3770
uses: thollander/actions-comment-pull-request@v3
3871
env:
3972
GITHUB_TOKEN: ${{ secrets.TOKEN }}
4073
with:
41-
message: "storybook: ${{ steps.chromatic.outputs.storybookUrl }}"
74+
comment_tag: ${{ github.event.number }}-storybook
75+
message: |
76+
77+
💄 Storybook: ${{ needs.storybook-preview.outputs.storybook_url }}
78+
🕖 Update: ${{ needs.storybook-preview.outputs.currnent_time }}

0 commit comments

Comments
 (0)