Skip to content

Commit

Permalink
feat: chromatic setup
Browse files Browse the repository at this point in the history
  • Loading branch information
hynseok committed Jul 16, 2024
1 parent 725f2e9 commit e49bb17
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 1 deletion.
41 changes: 41 additions & 0 deletions .github/workflows/storybook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Storybook Deployment
run-name: ${{ github.actor }}'s Storybook Deployment
on:
pull_request:
branches:
- develop
jobs:
storybook:
runs-on: ubuntu-20.04
outputs:
status: ${{ job.status }}
steps:
- name: checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: cache dependencies
id: cache
uses: actions/cache@v3
with:
path: "**/node_modules"
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}-storybook

- name: depedency install
if: steps.cache.outputs.cache-hit != 'true'
run: npm ci

- name: publish to chromatic
id: chromatic
uses: chromaui/action@v1
with:
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
token: ${{ secrets.ACTION_TOKEN }}

- name: comment PR
uses: thollander/actions-comment-pull-request@v1
env:
GITHUB_TOKEN: ${{ secrets.ACTION_TOKEN }}
with:
message: "🚀storybook: ${{ steps.chromatic.outputs.storybookUrl }}"
1 change: 1 addition & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"prepare": "husky",
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build",
"test": "jest"
"test": "jest",
"chromatic": "npx chromatic --project-token=chpt_4df1876da1b9766"
},
"dependencies": {
"@mantine/core": "^7.11.1",
Expand Down Expand Up @@ -44,6 +45,7 @@
"@types/react-dom": "^18",
"@typescript-eslint/eslint-plugin": "^7.16.0",
"@typescript-eslint/parser": "^7.16.0",
"chromatic": "^11.5.5",
"eslint": "^8.57.0",
"eslint-config-next": "^14.2.4",
"eslint-config-prettier": "^9.1.0",
Expand Down

0 comments on commit e49bb17

Please sign in to comment.