-
Notifications
You must be signed in to change notification settings - Fork 7
70 lines (59 loc) · 1.72 KB
/
storybook-ci-cd.yml
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: Deploy Storybook Production
on:
push:
branches:
- main
- develop
paths:
- 'client/**'
- 'core/**'
- '.github/workflows/storybook-*.yml'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v3
with:
version: 9
run_install: false
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
cache-dependency-path: '**/pnpm-lock.yaml'
- name: Install all dependencies
run: pnpm install --frozen-lockfile
- name: Build core package
run: |
echo "Building core package..."
pnpm --filter @troublepainter/core build
echo "Core build output:"
ls -la core/dist/
- name: Verify core build
run: |
if [ ! -f "core/dist/index.mjs" ]; then
echo "Core build failed - index.mjs not found"
exit 1
fi
- name: Build storybook
working-directory: ./client
run: |
echo "Building Storybook with core from $(realpath ../core/dist/)"
pnpm build-storybook
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./client/storybook-static
destination_dir: ${{ github.ref == 'refs/heads/main' && 'storybook' || 'storybook-develop' }}
keep_files: true
commit_message: 'docs: deploy storybook'