refactor: setup workspaces and monorepo with turbo repo #359
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Storybook Tests (Pre-Deployment) | |
on: push | |
jobs: | |
test-storybook: | |
timeout-minutes: 10 | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Install pnpm | |
uses: pnpm/action-setup@v4 | |
with: | |
version: 9.5.0 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: '.nvmrc' | |
- name: Install dependencies | |
run: pnpm install | |
- name: Build Storybook | |
run: pnpm build | |
- name: Serve Storybook and run tests | |
run: | | |
npx concurrently -k -s first -n "SB,TEST" -c "magenta,blue" \ | |
"npx http-server apps/storybook/storybook-static --port 6006 --silent" \ | |
"npx wait-on tcp:6006 && pnpm test-storybook" | |
chromatic: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Install pnpm | |
uses: pnpm/action-setup@v4 | |
with: | |
version: 9.5.0 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: '.nvmrc' | |
- name: Install dependencies | |
run: pnpm install | |
- name: Publish to Chromatic | |
uses: chromaui/action@latest | |
with: | |
# ⚠️ Make sure to configure a `CHROMATIC_PROJECT_TOKEN` repository secret | |
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} | |
workingDir: apps/storybook |