-
Notifications
You must be signed in to change notification settings - Fork 201
97 lines (86 loc) · 2.74 KB
/
storybook-deploy-all.yml
File metadata and controls
97 lines (86 loc) · 2.74 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
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: Storybook — Rebuild for release branches
# This workflow rebuilds Storybook for all release branches in a single run.
# Triggered manually via GitHub Actions UI.
#
# When to use:
# - When the previous Pages artifact expires (30 days)
# - Initial setup before automatic deployments have run on all branches
# - To rebuild all versions from scratch
#
# How it works:
# 1. Builds Storybook for each branch (master, release-6.x, develop-8.0) independently
# 2. Combines all builds into a single deployment structure
# 3. Uploads and deploys to GitHub Pages via Actions Artifacts
on:
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
# Allow only one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
- name: Build master branch
run: |
git clone --depth 1 --branch master https://github.com/${{ github.repository }}.git master
cd master
npm ci
npm run build-stories
cd ..
mkdir -p deploy-root/master
cp -r master/storybook-dist/. deploy-root/master/
- name: Build release-6.x branch
run: |
git clone --depth 1 --branch release-6.x https://github.com/${{ github.repository }}.git release-6.x
cd release-6.x
npm ci
npm run build-stories
cd ..
mkdir -p deploy-root/release-6.x
cp -r release-6.x/storybook-dist/. deploy-root/release-6.x/
- name: Build develop-8.0 branch
run: |
git clone --depth 1 --branch develop-8.0 https://github.com/${{ github.repository }}.git develop-8.0
cd develop-8.0
npm ci
npm run build-stories
cd ..
mkdir -p deploy-root/develop-8.0
cp -r develop-8.0/storybook-dist/. deploy-root/develop-8.0/
- name: Create root index
run: |
cat > deploy-root/index.html << 'EOF'
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Ring UI - Storybook</title>
<meta http-equiv="refresh" content="0; url=/ring-ui/master/">
</head>
</html>
EOF
- name: Upload Pages artifact
id: deployment
uses: actions/upload-pages-artifact@v3
with:
path: deploy-root
retention-days: 60
deploy:
runs-on: ubuntu-latest
needs: build
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4