Skip to content

Commit

Permalink
chore: publish example storybook to chromatic (#32)
Browse files Browse the repository at this point in the history
* chore: publish example storybook to chromatic

Closes #31

* only publish once

* fix linter

* only use two equal signs

* upload codecov also only once

* fix linter
  • Loading branch information
tobiasdiez committed Mar 9, 2023
1 parent 0ed872c commit 80e1b63
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 8 deletions.
40 changes: 33 additions & 7 deletions .github/workflows/ci.yml
Expand Up @@ -12,9 +12,14 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: corepack enable
- uses: actions/setup-node@v3
- name: Checkout
uses: actions/checkout@v3

- name: Setup pnpm
uses: pnpm/action-setup@v2

- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 16
cache: 'pnpm'
Expand All @@ -35,9 +40,15 @@ jobs:
fail-fast: false

steps:
- uses: actions/checkout@v3
- run: corepack enable
- name: Set node ${{ matrix.node }}
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup pnpm
uses: pnpm/action-setup@v2

- name: Setup node ${{ matrix.node }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
Expand All @@ -52,4 +63,19 @@ jobs:
- name: Test
run: pnpm run test --coverage

- uses: codecov/codecov-action@v3
- name: Build example Storybook
run: pnpm run example:vite:build

- name: Publish and test example Storybook
if: matrix.node == '16.x' && matrix.os == 'ubuntu-latest'
uses: chromaui/action@v1
with:
projectToken: '574df7cc3736'
# Don't wait until Chroma verified the build (for this we have the Github check)
exitOnceUploaded: true
storybookBuildDir: examples/vite/storybook-static/
debug: true

- name: Upload coverage
if: matrix.node == '16.x' && matrix.os == 'ubuntu-latest'
uses: codecov/codecov-action@v3
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -79,3 +79,6 @@ dist

# IDE
.idea

# Storybook build output
examples/vite/storybook-static/
2 changes: 1 addition & 1 deletion .vscode/settings.json
@@ -1,3 +1,3 @@
{
"cSpell.words": ["nuxt", "Unplugin"]
"cSpell.words": ["chromaui", "nuxt", "pnpm", "Unplugin", "vite"]
}
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -81,6 +81,7 @@
"lint:prettier": "prettier --check --ignore-path .gitignore . \"!pnpm-lock.yaml\"",
"play": "npm -C playground run dev",
"example:vite": "npm -C examples/vite run storybook",
"example:vite:build": "npm -C examples/vite run build-storybook",
"example:vite:app": "npm -C examples/vite run dev",
"test": "vitest"
},
Expand Down

0 comments on commit 80e1b63

Please sign in to comment.