-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (50 loc) · 1.47 KB
/
publish-version-and-storybook-after-merge.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
name: publish-version-and-storybook-after-merge
on:
pull_request:
branches:
- main
types:
- closed
# limit concurrency, so only 1 runs at a time
concurrency:
group: publish-version-and-storybook-after-merge
jobs:
publish-version-and-storybook-after-merge:
if: github.event.pull_request.merged
runs-on: ubuntu-latest
permissions:
packages: write
contents: write
pages: write
id-token: write
steps:
- uses: actions/checkout@v3
with:
ref: main
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: 18
registry-url: "https://npm.pkg.github.com"
scope: "@danwulff"
- name: Install dependencies
run: npm ci
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build Styles & Components
run: npm run build
- name: Publish package version
run: npm run publish-version -- ${{ github.event.pull_request.number }} '${{ toJson(github.event.pull_request.labels.*.name) }}'
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build Storybook
run: npm run storybook-build
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: "storybook/dist/"
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1