chore: move storybook to root package #740
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
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions | |
name: Build & Release | |
on: | |
push: | |
pull_request: | |
branches: [master] | |
types: [opened, synchronize, closed] | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20.x | |
cache: "yarn" | |
- name: Install dependencies π | |
run: yarn install --immutable | |
- name: Run lint | |
run: yarn lint | |
test: | |
runs-on: "ubuntu-latest" | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20.x | |
cache: "yarn" | |
- name: Install dependencies π | |
run: yarn install --immutable | |
- name: Run test π | |
run: yarn test | |
test-storybook: | |
timeout-minutes: 60 | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20.x | |
cache: "yarn" | |
- name: Install dependencies π | |
run: yarn install --immutable | |
- name: Install Playwright π | |
run: yarn playwright install | |
- name: Build Storybook | |
run: yarn storybook:build --quiet | |
- name: Serve Storybook and run tests π | |
run: | | |
npx concurrently -k -s first -n "SB,TEST" -c "magenta,blue" \ | |
"npx http-server storybook-static --port 6006 --silent" \ | |
"npx wait-on tcp:6006 && yarn storybook:test:ci" | |
deploy-packages: | |
runs-on: ubuntu-latest | |
needs: [lint, test, test-storybook] | |
if: ${{ github.event_name != 'pull_request' && (contains(github.ref, 'master') || contains(github.ref, 'alpha') || contains(github.ref, 'beta') || contains(github.ref, 'rc')) }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20.x | |
cache: "yarn" | |
- name: Install dependencies π | |
run: yarn install --immutable | |
- name: Release packages | |
env: | |
CI: true | |
GH_TOKEN: ${{ secrets.GH_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | |
run: yarn release |