From 057a0d7390ea5fee1ffc277de93b3d98bdaf7499 Mon Sep 17 00:00:00 2001 From: "Lukas.J.Han" Date: Mon, 5 Aug 2024 13:33:01 +0900 Subject: [PATCH] ci: add storybook gh page (#28) Signed-off-by: Lukas.J.Han --- .github/workflows/storybook.yaml | 39 ++++++++++++++++++++++++++++++++ .gitignore | 3 ++- 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/storybook.yaml diff --git a/.github/workflows/storybook.yaml b/.github/workflows/storybook.yaml new file mode 100644 index 0000000..af789aa --- /dev/null +++ b/.github/workflows/storybook.yaml @@ -0,0 +1,39 @@ +name: Build and Publish Storybook to GitHub Pages + +on: + # Event for the workflow to run on + push: + branches: + - 'main' # Replace with the branch you want to deploy from + +permissions: + contents: read + pages: write + id-token: write + +# List of jobs +jobs: + deploy: + runs-on: ubuntu-latest + # Job steps + steps: + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v3 + with: + version: 9 + - run: pnpm add -g pnpm + - name: 'Setup Node.js with pnpm cache' + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: 'pnpm' + - run: pnpm install + - run: pnpm build + + #👇 Add Storybook build and deploy to GitHub Pages as a step in the workflow + - uses: bitovi/github-actions-storybook-to-github-pages@v1.0.3 + with: + install_command: pnpm install + build_command: pnpm build-storybook + path: storybook-static + checkout: false diff --git a/.gitignore b/.gitignore index bc6d306..7b74e43 100644 --- a/.gitignore +++ b/.gitignore @@ -23,4 +23,5 @@ dist-ssr *.sln *.sw? -*storybook.log \ No newline at end of file +*storybook.log +storybook-static \ No newline at end of file