diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index fd71443..8b4897f 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -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 diff --git a/.github/workflows/build-storybook.yml b/.github/workflows/build-storybook.yml new file mode 100644 index 0000000..32ed0c9 --- /dev/null +++ b/.github/workflows/build-storybook.yml @@ -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 diff --git a/.gitignore b/.gitignore index 2dc39e4..4f6a59a 100644 --- a/.gitignore +++ b/.gitignore @@ -30,3 +30,4 @@ coverage *.tsbuildinfo *storybook.log +storybook-static diff --git a/package.json b/package.json index d60801a..9210525 100644 --- a/package.json +++ b/package.json @@ -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",