Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: added storybook configruation for publishing on chromatic #3548

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/chromatic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Workflow name
name: 'Chromatic Publish'

# Event for the workflow
on: push
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on push of which branch? Kindly mention it out.

Also, do we need chromatic URL for PR deploys as well?


# List of jobs
jobs:
test:
# Operating System
runs-on: ubuntu-latest
# Job steps
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 20
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use the existing node version present in the .nvmrc file?

cache: 'npm'
- run: npm ci
#👇 Adds Chromatic as a step in the workflow
- uses: chromaui/action@latest
# Options required for Chromatic's GitHub Action
with:
#👇 Chromatic projectToken,
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to create a custom project using asyncapi account in chromatic?

token: ${{ secrets.GITHUB_TOKEN }}
7 changes: 4 additions & 3 deletions package-lock.json

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

11 changes: 8 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
"test:md": "node scripts/markdown/check-markdown.js",
"test:editlinks": "node scripts/markdown/check-edit-links.js",
"dev:storybook": "storybook dev -p 6006",
"build:storybook": "storybook build"
"build:storybook": "storybook build",
"chromatic": "npx chromatic --build-script-name=build:storybook"
},
"repository": {
"type": "git",
Expand All @@ -39,7 +40,10 @@
"homepage",
"site"
],
"author": "Fran Mendez <[email protected]>",
"author": {
"name": "Fran Mendez",
"email": "[email protected]"
},
"license": "Apache-2.0",
"bugs": {
"url": "https://github.com/asyncapi/website/issues"
Expand Down Expand Up @@ -139,6 +143,7 @@
"@types/react-youtube-embed": "^1.0.4",
"@typescript-eslint/eslint-plugin": "^6.21.0",
"@typescript-eslint/parser": "^6.21.0",
"chromatic": "^11.22.0",
"dedent": "^1.5.1",
"eslint": "^8",
"eslint-config-airbnb-typescript": "^17.1.0",
Expand All @@ -161,4 +166,4 @@
"remark-mdx": "^3.0.1",
"storybook": "^8.2.4"
}
}
}
Loading