Skip to content

Commit

Permalink
fix: chromatic deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
samshara committed Jun 21, 2024
1 parent 57c4481 commit 33e0989
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 9 deletions.
42 changes: 37 additions & 5 deletions .github/workflows/chromatic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,37 @@ on:
- project/storybook

jobs:
chromatic:
ui:
name: Build UI Library
environment: 'test'
runs-on: ubuntu-latest
defaults:
run:
working-directory: packages/go-ui-storybook
working-directory: packages/ui
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'yarn'
- name: Install dependencies on UI library
run: yarn install --frozen-lockfile
- name: Typecheck
run: yarn typecheck
- name: Lint CSS
run: yarn lint:css
- name: Lint JS
run: yarn lint:js
- name: build UI library
run: yarn build
- uses: actions/upload-artifact@v4
with:
name: ui-build
path: packages/ui/dist
chromatic:
name: Chromatic Deploy
runs-on: ubuntu-latest
needs: [ui]
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -19,12 +45,18 @@ jobs:
with:
node-version: 20
cache: 'yarn'
- run: yarn
- uses: actions/download-artifact@v4
with:
name: ui-build
path: packages/ui/dist
- name: Install dependencies
run: yarn install --frozen-lockfile
#👇 Adds Chromatic as a step in the workflow
- uses: chromaui/action@v1
- name: Run Chromatic
uses: chromaui/action@v1
# Options required for Chromatic's GitHub Action
with:
#👇 Chromatic projectToken
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
token: ${{ secrets.GITHUB_TOKEN }}
working-directory: packages/go-ui-storybook
workingDir: packages/go-ui-storybook
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ env:

jobs:
ui:
name: UI library
name: Build UI Library
environment: 'test'
runs-on: ubuntu-latest
defaults:
Expand Down Expand Up @@ -194,7 +194,7 @@ jobs:
# - name: Typecheck
# run: yarn typecheck
build:
name: Build
name: Build Go Web App
environment: 'test'
needs: [lint, lint-css, test, ui]
runs-on: ubuntu-latest
Expand Down
3 changes: 1 addition & 2 deletions packages/go-ui-storybook/.storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import '@ifrc-go/ui/index.css';
import type { Preview } from "@storybook/react";

import '@ifrc-go/ui/index.css';
import '../src/stories/index.css';

const preview: Preview = {
Expand Down

0 comments on commit 33e0989

Please sign in to comment.