Skip to content

Refactor/three package (#251) #484

Refactor/three package (#251)

Refactor/three package (#251) #484

Workflow file for this run

name: Build and deploy storybook
on:
push:
branches:
- main
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v4
with:
persist-credentials: false
# Install pnpm
- name: Install pnpm
run: npm install -g pnpm
- name: Install and build 🔧
run: | # Install packages and build the Storybook files
pnpm i
npx nx run-many -t build-catalogue-meta --all --exclude docs
npx nx run-many -t build-storybook --all --exclude docs
- name: Collect Storybook builds 📦
run: |
mkdir -p docs-build
for dir in apps packages; do
echo "Collecting Storybook builds from $dir"
for subdir in $dir/*/; do
name=$(basename "$subdir")
if [ -d "$subdir/storybook-static" ]; then
echo "Processing $subdir"
mv "$subdir/storybook-static" "docs-build/$name"
fi
done
done
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@3.6.2
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: docs # The branch the action should deploy to.
FOLDER: docs-build # The folder that the build-storybook script generates files.
CLEAN: true # Automatically remove deleted files from the deploy branch
TARGET_FOLDER: docs # The folder that we serve our Storybook files from