Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add workflow to deploy storybook to github page #5

Merged
merged 2 commits into from
Apr 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions .github/workflows/deploy-storybook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Deploy Storybook to Github Page for PR

on:
pull_request:
branches: ['main']

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

concurrency:
group: "pages"
cancel-in-progress: false

jobs:
main:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
steps:
- name: Checkout the codebase
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Install Dependencies
run: npm ci

- name: Build Storybook
run: npm run build-storybook

- name: Setup Pages
uses: actions/configure-pages@v5

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./storybook-static

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
6 changes: 0 additions & 6 deletions .storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
import type { Preview } from "@storybook/react";
import '../styles/globals.css'; // replace with the name of your tailwind css file

import { initialize, mswLoader } from 'msw-storybook-addon';

// Initialize MSW
initialize();

const preview: Preview = {
parameters: {
actions: { argTypesRegex: "^on[A-Z].*" },
Expand All @@ -16,7 +11,6 @@ const preview: Preview = {
},
},
},
loaders: [mswLoader],
};

export default preview;
Expand Down
5 changes: 0 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,10 @@
"eslint": "^8",
"eslint-config-next": "13.5.4",
"eslint-plugin-storybook": "^0.6.15",
"msw": "^1.3.2",
"msw-storybook-addon": "^1.10.0",
"plop": "^4.0.0",
"postcss": "^8",
"storybook": "^8.0.0-beta.1",
"tailwindcss": "^3",
"typescript": "^5"
},
"msw": {
"workerDirectory": "public"
}
}
79 changes: 0 additions & 79 deletions pages/index.stories.tsx

This file was deleted.

Loading
Loading