Skip to content

Commit

Permalink
feat: setup chromatic
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmadshaheer committed Oct 20, 2024
1 parent f198b63 commit d67cf23
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 3 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/chromatic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: "Chromatic"
on: push
jobs:
chromatic:
name: Run Chromatic
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup pnpm
uses: pnpm/action-setup@v3
with:
version: 8
- name: Setup Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20
cache: "pnpm"
- name: Install Dependencies and Build
run: |
pnpm install
pnpm build
- name: Run Chromatic
uses: chromaui/action@latest
with:
# ⚠️ Make sure to configure a `CHROMATIC_PROJECT_TOKEN` repository secret
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
4 changes: 3 additions & 1 deletion apps/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
"dev": "storybook dev -p 6006",
"build": "storybook build --docs",
"preview-storybook": "serve storybook-static",
"build-storybook": "storybook build -o storybook-static",
"clean": "rm -rf .turbo && rm -rf node_modules",
"lint": "eslint ./stories/*.stories.tsx --max-warnings 0"
"lint": "eslint ./stories/*.stories.tsx --max-warnings 0",
"chromatic": "pnpm dlx chromatic --exit-zero-on-changes "
},
"dependencies": {
"@signozhq/button": "workspace:*",
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
"lint": "turbo run lint",
"clean": "turbo run clean && rm -rf node_modules",
"format": "prettier --write \"**/*.{ts,tsx,md}\"",
"build-storybook": "turbo run build-storybook -- --output-dir=storybook-static",
"chromatic": "pnpm install && pnpm build --filter=docs^... && turbo run chromatic --",
"changeset": "changeset",
"version-packages": "changeset version",
"update-version": "changeset && changeset version",
Expand Down
4 changes: 2 additions & 2 deletions pnpm-lock.yaml

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

7 changes: 7 additions & 0 deletions turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,16 @@
"outputs": ["dist/**", "storybook-static/**"],
"dependsOn": ["^build"]
},
"build-storybook": {
"dependsOn": ["^build-storybook"],
"outputs": ["storybook-static/**"]
},
"lint": {
"dependsOn": ["^lint"]
},
"chromatic": {
"dependsOn": ["^chromatic"]
},
"dev": {
"cache": false,
"persistent": true
Expand Down

0 comments on commit d67cf23

Please sign in to comment.