better github action for chromatic

This commit is contained in:
Jon McClure 2023-07-06 18:03:30 +01:00
parent eaf144e0b5
commit e01ec8372b
3 changed files with 19 additions and 8 deletions

18
.github/workflows/chromatic.yaml vendored Normal file
View file

@ -0,0 +1,18 @@
name: Chromatic
on: push
jobs:
chromatic-deployment:
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install dependencies
run: yarn
- name: Publish to Chromatic
uses: chromaui/action@v1
with:
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
buildScriptName: build:docs

View file

@ -63,9 +63,3 @@ jobs:
git add .
git commit -m "published ${{ github.ref_name }}"
git push
- id: publish-chromatic
name: Chromatic
run: npm run chromatic
env:
CHROMATIC_PROJECT_TOKEN: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}

View file

@ -15,8 +15,7 @@
"build:docs": "storybook build -o docs && touch ./docs/.nojekyll",
"build": "npm-run-all build:package build:docs",
"prepublishOnly": "npm run build:package",
"postversion": "git push origin && git push origin --tags",
"chromatic": "npx chromatic --build-script-name build:docs"
"postversion": "git push origin && git push origin --tags"
},
"license": "MIT",
"types": "./dist/@types/index.d.ts",