Skip to content

Commit

Permalink
Merge pull request #17 from Central-MakeUs/chore-16
Browse files Browse the repository at this point in the history
chore: 스토리북 배포
  • Loading branch information
DongjaJ authored Jan 17, 2025
2 parents 8339a50 + af94ceb commit 7c7810f
Show file tree
Hide file tree
Showing 6 changed files with 81 additions and 21 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/chromatic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: 'Chromatic'

on:
push:
branches: [main]
pull_request:
types: [opened, synchronize, reopened]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
chromatic:
name: Run Chromatic
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.ref }}

env:
CHROMATIC_BRANCH: ${{ github.event.pull_request.head.ref || github.ref_name }}
CHROMATIC_SHA: ${{ github.event.pull_request.head.sha || github.ref }}
CHROMATIC_SLUG: ${{ github.repository }}

- name: pnpm-setup-node
uses: ./.github/actions/pnpm-setup-node

- name: Install dependencies
# ⚠️ See your package manager's documentation for the correct command to install dependencies in a CI environment.
run: pnpm install --frozen-lockfile

- name: Run Chromatic
id: chromatic
uses: chromaui/action@latest
with:
# ⚠️ Make sure to configure a `CHROMATIC_PROJECT_TOKEN` repository secret
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
token: ${{ secrets.GITHUB_TOKEN }}
onlyChanged: true
exitZeroOnChanges: true

- name: comment PR
if: github.event_name == 'pull_request'&& steps.chromatic.outputs.storybookUrl != ''
uses: thollander/actions-comment-pull-request@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
message: |
🚀 Storybook 리뷰가 준비되었습니다:
- 프리뷰: ${{ steps.chromatic.outputs.storybookUrl }}
- 빌드: ${{ steps.chromatic.outputs.buildUrl }}
comment-tag: chromatic
2 changes: 0 additions & 2 deletions .github/ci.yml → .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ on:
branches: [main]
pull_request:
types: [opened, synchronize, reopened]
env:
CI: ${{ vars.CI }}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,5 @@ dist-ssr

*storybook.log

testResults.json
testResults.json
storybook-static
3 changes: 2 additions & 1 deletion eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import globals from 'globals';
import tseslint from 'typescript-eslint';

export default tseslint.config(
{ ignores: ['dist'] },
{ ignores: ['dist', 'storybook-static', 'pnpm-lock.yaml'] },
eslint.configs.recommended,
importPlugin.flatConfigs.recommended,
tseslint.configs.recommended,
Expand Down Expand Up @@ -117,6 +117,7 @@ export default tseslint.config(
},
{
files: ['*.js'],
ignores: ['dist', 'storybook-static'],
rules: {
'@typescript-eslint/no-require-imports': 'off',
},
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"private": true,
"version": "0.0.0",
"type": "module",
"packageManager": "[email protected]",
"scripts": {
"dev": "vite",
"build": "tsc -b && vite build",
Expand Down Expand Up @@ -65,6 +66,7 @@
"@vitest/coverage-v8": "^2.1.8",
"@vitest/eslint-plugin": "^1.1.24",
"@vitest/ui": "^2.1.8",
"chromatic": "^11.24.0",
"eslint": "^9.17.0",
"eslint-import-resolver-typescript": "^3.7.0",
"eslint-plugin-import": "^2.31.0",
Expand Down
37 changes: 20 additions & 17 deletions pnpm-lock.yaml

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

0 comments on commit 7c7810f

Please sign in to comment.