-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from dnd-side-project/feat/storybook-setup
스토리북 및 크로마틱 자동 배포 워크플로우 추가 셋업
- Loading branch information
Showing
14 changed files
with
10,068 additions
and
1,964 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* @froggy1014 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# .github/workflows/chromatic.yml | ||
name: "Chromatic Deployment" | ||
run-name: Storybook deployment by ${{ github.actor }} | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- develop | ||
paths: | ||
- "**.stories.tsx" | ||
|
||
jobs: | ||
chromatic: | ||
name: Run Chromatic Deployment | ||
# Operating System | ||
runs-on: ubuntu-latest | ||
outputs: | ||
status: ${{ job.status }} | ||
|
||
# Job steps | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- uses: pnpm/action-setup@v4 | ||
name: Install pnpm | ||
with: | ||
version: 9 | ||
run_install: false | ||
|
||
- name: Set up Node.js version | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 20.x | ||
cache: "pnpm" | ||
cache-dependency-path: "**/pnpm-lock.yaml" | ||
|
||
- name: Install dependencies | ||
run: pnpm install | ||
|
||
- name: Run Chromatic | ||
id: chromatic | ||
uses: chromaui/action@latest | ||
with: | ||
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} | ||
buildScriptName: build-storybook | ||
onlyChanged: true | ||
|
||
- name: comment PR | ||
uses: thollander/actions-comment-pull-request@v1 | ||
if: ${{ github.event_name == 'pull_request' }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
message: "💅 ## storybook-URL - ${{ steps.chromatic.outputs.storybookUrl }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import type { StorybookConfig } from "@storybook/nextjs"; | ||
|
||
const config: StorybookConfig = { | ||
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"], | ||
addons: [ | ||
"@storybook/addon-onboarding", | ||
"@storybook/addon-links", | ||
"@storybook/addon-essentials", | ||
"@chromatic-com/storybook", | ||
"@storybook/addon-interactions", | ||
], | ||
framework: { | ||
name: "@storybook/nextjs", | ||
options: {}, | ||
}, | ||
staticDirs: ["../public"], | ||
|
||
typescript: { | ||
reactDocgen: "react-docgen-typescript", | ||
}, | ||
}; | ||
export default config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import type { Preview } from "@storybook/react"; | ||
import "../src/styles/globals.css"; | ||
|
||
const preview: Preview = { | ||
parameters: { | ||
controls: { | ||
matchers: { | ||
color: /(background|color)$/i, | ||
date: /Date$/i, | ||
}, | ||
}, | ||
}, | ||
}; | ||
|
||
export default preview; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.