Skip to content

Commit

Permalink
feat: handle chromatic
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelxsilva committed Feb 7, 2024
1 parent 19956bf commit f6fd102
Showing 1 changed file with 38 additions and 5 deletions.
43 changes: 38 additions & 5 deletions .github/workflows/storybook-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,19 @@ jobs:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
- name: Cache Yarn dependencies
uses: actions/cache@v2
with:
path: |
.yarn/cache
**/node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn
- name: Install Playwright
Expand All @@ -24,10 +33,34 @@ jobs:
run: yarn storybook:build --quiet
- name: Serve Storybook and run tests
run: |
npx concurrently -k -s first -n "SB,TEST" -c "magenta,blue" \
npx concurrently -k -s first -n "SB,TEST" -c "magenta,blue" \
"npx http-server storybook-static --port 6006 --silent" \
"npx wait-on http-get://127.0.0.1:6006 && yarn storybook:test"
- name: Chromatic Build
run: yarn storybook:chromatic

chromatic:
if: secrets.CHROMATIC_PROJECT_TOKEN != ''
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
- name: Cache Yarn dependencies
uses: actions/cache@v2
with:
path: |
.yarn/cache
**/node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn
- name: Publish to Chromatic
uses: chromaui/action@latest
with:
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
autoAcceptChanges: "main"
buildScriptName: "storybook:chromatic"
env:
CI: true

0 comments on commit f6fd102

Please sign in to comment.