-
Notifications
You must be signed in to change notification settings - Fork 36
117 lines (101 loc) · 4.28 KB
/
deploy-storybook-only.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
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# Aim of this Github action is to deploy storybook for further testing and review while working on a feature/bug branch.
name: Deploy Storybook Only
permissions: read-all
on:
workflow_dispatch:
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
check-updates:
name: "Check package updates"
runs-on: ubuntu-latest
permissions:
pull-requests: read
outputs:
core: ${{ steps.filter.outputs.core }}
canary: ${{ steps.filter.outputs.canary }}
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 #v3.0.2
id: filter
with:
base: "develop"
filters: |
core:
- 'packages/web-components/**'
- 'packages/react/**'
canary:
- 'packages/canary-web-components/**'
- 'packages/canary-react/**'
ic-ui-kit-deploy:
needs: [check-updates]
if: ${{ github.event.pull_request.head.repo.full_name == github.repository || github.event_name == 'workflow_dispatch' }}
name: "Deploy storybook"
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1
- name: Setup node
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 #4.0.2
with:
node-version: 20
- name: Cache dependencies
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 #v4.2.0
with:
path: |
packages/*/node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node
- name: Extract branch name
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
id: extract_branch
- name: Install dependencies
run: |
npm ci
npm run bootstrap -- -- --ci
- name: Build core components
if: ${{ needs.check-updates.outputs.canary == 'false' }}
run: |
npm run build
- name: Build all components
if: ${{ needs.check-updates.outputs.canary == 'true' }}
run: |
npm run build:all
- name: Build web-components and react storybook
if: ${{ needs.check-updates.outputs.core == 'true' }}
run: |
npm run build-storybook:web-components
npm run build-storybook:react
- name: Build canary web-components and canary react storybook
if: ${{ needs.check-updates.outputs.canary == 'true' }}
run: |
npm run build-storybook:canary-web-components
npm run build-storybook:canary-react
- name: Deploy core web components storybook
if: ${{ needs.check-updates.outputs.core == 'true' }}
uses: JamesIves/github-pages-deploy-action@65b5dfd4f5bcd3a7403bbc2959c144256167464e #v4.5.0
with:
folder: ./packages/web-components/storybook-static
target-folder: ./branches/${{ steps.extract_branch.outputs.branch }}/web-components
- name: Deploy core react storybook
if: ${{ needs.check-updates.outputs.core == 'true' }}
uses: JamesIves/github-pages-deploy-action@65b5dfd4f5bcd3a7403bbc2959c144256167464e #v4.5.0
with:
folder: ./packages/react/storybook-static
target-folder: ./branches/${{ steps.extract_branch.outputs.branch }}/react
- name: Deploy canary web components storybook
if: ${{ needs.check-updates.outputs.canary == 'true' }}
uses: JamesIves/github-pages-deploy-action@65b5dfd4f5bcd3a7403bbc2959c144256167464e #v4.5.0
with:
folder: ./packages/canary-web-components/storybook-static
target-folder: ./branches/${{ steps.extract_branch.outputs.branch }}/canary-web-components
- name: Deploy canary react storybook
if: ${{ needs.check-updates.outputs.canary == 'true' }}
uses: JamesIves/github-pages-deploy-action@65b5dfd4f5bcd3a7403bbc2959c144256167464e #v4.5.0
with:
folder: ./packages/canary-react/storybook-static
target-folder: ./branches/${{ steps.extract_branch.outputs.branch }}/canary-react