-
Notifications
You must be signed in to change notification settings - Fork 2
103 lines (88 loc) · 2.87 KB
/
release.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
name: path
on:
push:
branches:
- main
workflow_dispatch:
defaults:
run:
shell: bash
jobs:
changes:
runs-on: ubuntu-latest
permissions:
pull-requests: read
outputs:
ssBtn: ${{ steps.filter.outputs.ssBtn }}
ssHeader: ${{ steps.filter.outputs.ssHeader }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Check for changes
uses: dorny/paths-filter@v3
id: filter
with:
filters: |
ssBtn:
- 'package/ss-button/**'
ssHeader:
- 'package/ss-header/**'
ssBtn:
needs: changes
if: ${{ needs.changes.outputs.ssBtn == 'true' }}
name: create build
uses: ./.github/workflows/build.yml
with:
working-directory: package/ss-button
ssBtnPublish:
needs: [ssHeader, ssBtn]
if: ${{ always() && needs.ssBtn.result == 'success' && (needs.ssHeader.result == 'success' || needs.ssHeader.result == 'skipped') }}
name: publish package
uses: ./.github/workflows/publish-package.yml
with:
working-directory: package/ss-button
secrets:
MY_SECRET: ${{ secrets.NPM_PUBLISH_WORKFLOW }}
ssHeader:
needs: changes
if: ${{ needs.changes.outputs.ssHeader == 'true' }}
name: create build
uses: ./.github/workflows/build.yml
with:
working-directory: package/ss-header
ssHeaderPublish:
needs: [ssHeader, ssBtn]
if: ${{ always() && needs.ssHeader.result == 'success' && (needs.ssBtn.result == 'success' || needs.ssBtn.result == 'skipped') }}
name: publish package
uses: ./.github/workflows/publish-package.yml
with:
working-directory: package/ss-header
secrets:
MY_SECRET: ${{ secrets.NPM_PUBLISH_WORKFLOW }}
publish-storybook:
runs-on: ubuntu-latest
needs: [ssHeaderPublish, ssBtnPublish]
if: ${{ always() &&( (needs.ssHeaderPublish.result == 'success' && (needs.ssBtnPublish.result == 'success' || needs.ssBtnPublish.result == 'skipped')) || (needs.ssBtnPublish.result == 'success' && (needs.ssHeaderPublish.result == 'success' || needs.ssHeaderPublish.result == 'skipped')) )}}
defaults:
run:
working-directory: storybook
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 18 # Adjust to your Node.js version
cache: "npm"
registry-url: https://registry.npmjs.org
- name: Install dependencies
run: npm install
- name: Build Storybook
run: npm run build-storybook
- name: List contents of Storybook build directory
run: ls ./storybook-static
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: storybook-static