-
Notifications
You must be signed in to change notification settings - Fork 22
44 lines (42 loc) · 1.5 KB
/
storybook.yml
File metadata and controls
44 lines (42 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
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