Skip to content

Commit

Permalink
build(setup): Deploy storybook to github pages
Browse files Browse the repository at this point in the history
  • Loading branch information
joerideg committed Jul 5, 2024
1 parent ab00ee2 commit 427dff2
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/cicd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,51 @@ jobs:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: pnpm exec semantic-release -d ${{ github.event.inputs.dry_run }}

storybook:
needs: [release]
if:
${{ github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main' &&
needs.release.result == 'success' }}
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup PNPM
uses: pnpm/action-setup@v3
with:
run_install: false

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: package.json
cache: 'pnpm'
cache-dependency-path: pnpm-lock.yaml

- name: Install dependencies
run: pnpm install

- name: Build the TSDoc
run: pnpm storybook:build

- 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

sync_readme:
needs: [release]
if:
Expand Down

0 comments on commit 427dff2

Please sign in to comment.