Skip to content

Build and Deploy Storybook #184

Build and Deploy Storybook

Build and Deploy Storybook #184

Workflow file for this run

name: Build and Deploy Storybook
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
on:
push:
branches:
- master
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
name: Build all libs together
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Volta
run: |
curl https://get.volta.sh | bash
export VOLTA_HOME="$HOME/.volta"
export PATH="$VOLTA_HOME/bin:$PATH"
volta install node yarn
- name: Install dependencies
run: volta run yarn install --immutable
- name: Build all modules
run: volta run yarn build
- name: Build Storybook
run: yarn run build-storybook
- name: Modify permissions
run: |
find dist/storybook -type d -exec chmod 755 {} \;
find dist/storybook -type d -exec chmod 555 {} \;
find dist/storybook -type f -exec chmod 744 {} \;
find dist/storybook -type f -exec chmod 644 {} \;
find dist/storybook -type f -exec chmod 444 {} \;
- name: Upload storybook artifact
uses: actions/[email protected]
with:
path: dist/storybook
deploy:
runs-on: ubuntu-latest
name: Publish Storybook
needs: build
steps:
- name: Download build artifact
uses: actions/download-artifact@v4
with:
name: github-pages
- name: Deploy to GitHub Pages
uses: actions/deploy-pages@v4
with:
token: ${{ github.token }}
artifact_name: github-pages