Skip to content

Commit

Permalink
cd: deploy storybook to github pages
Browse files Browse the repository at this point in the history
  • Loading branch information
vitorxfs committed Oct 28, 2023
1 parent 21b487d commit eac4492
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/deploy-storybook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Deploy Storybook to Github Pages

on:
push:
branches:
- "main" # change to the branch you wish to deploy from

permissions:
contents: read
pages: write
id-token: write

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- run: pnpm install && pnpm run build-storybook
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: ./storybook-static

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: build
runs-on: ubuntu-latest
name: Deploy Storybook
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
with:
path: ./storybook-static
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,5 @@ yarn-error.log*
# typescript
*.tsbuildinfo
next-env.d.ts

storybook-static

0 comments on commit eac4492

Please sign in to comment.