Skip to content

Commit

Permalink
build: add github action tu publish storybook
Browse files Browse the repository at this point in the history
  • Loading branch information
caro3801 committed Jun 24, 2024
1 parent 4d5a5b6 commit 56f56cb
Showing 1 changed file with 60 additions and 0 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Workflow name
name: Build and Publish Storybook to GitHub Pages

on:
push:

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

jobs:

test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup Node 18
uses: actions/setup-node@v3
with:
node-version: '18.x'
cache: 'yarn'

- name: Install Node dependencies
run: yarn --frozen-lockfile

- name: Run tests
run: yarn test

publish:
if: github.ref == 'refs/heads/feat/sb'
needs: [test]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup Node 18
uses: actions/setup-node@v3
with:
node-version: '18.x'
cache: 'yarn'

- name: Install Node dependencies
run: yarn --frozen-lockfile

- name: Build storybook artifacts
run: yarn build:storybook

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

- name: Deploy artifact to Github Pages
uses: actions/deploy-pages@v4


0 comments on commit 56f56cb

Please sign in to comment.