Skip to content

Commit

Permalink
CI: Add storybook build (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mintoo200 authored Mar 14, 2024
2 parents c08453f + 3000a4b commit 9779561
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@ jobs:
build:
needs: [tests, type-check]
uses: ./.github/workflows/build.yml
build-storybook:
needs: [tests, type-check]
uses: ./.github/workflows/build-storybook.yml
26 changes: 26 additions & 0 deletions .github/workflows/build-storybook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: 'Build Storybook'

on: [workflow_call, workflow_dispatch]

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
with:
# TODO: add version to a .nvmrc or at least a variable
node-version: 18.12.1
cache: npm
- name: Install
run: npm ci --prefer-offline
- name: Build
run: npm run storybook:build
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: storybook-${{ github.sha }}
path: ./storybook-static
if-no-files-found: error
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@ coverage
*.tsbuildinfo

*storybook.log
storybook-static
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
"type-check": "vue-tsc --build --force",
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
"format": "prettier --write src/",
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build"
"storybook:start": "storybook dev -p 6006",
"storybook:build": "storybook build"
},
"dependencies": {
"vite-plugin-css-injected-by-js": "^3.4.0",
Expand Down

0 comments on commit 9779561

Please sign in to comment.