-
Notifications
You must be signed in to change notification settings - Fork 55
72 lines (60 loc) · 2.25 KB
/
pr-demo.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
name: PR Demo CI
on:
pull_request:
permissions:
contents: write
pull-requests: write
statuses: write
checks: write
pages: write
concurrency:
group: "${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}"
cancel-in-progress: true
jobs:
build:
name: Build demo on PR
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 #v3.5.3
- name: Use Node.js
uses: ./.github/actions/setup-node
- name: Install
working-directory: ./
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: yarn install --frozen-lockfile
- name: Build Demo
run: yarn test:demo
- name: Checkout demo branch
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 #v3.5.3
with:
path: demo
ref: gh-pages
- name: Add demo and commit it
# symlink creation : workaround to be able to use service worker on storybook both in local and via github pages deployment
run: |
cd demo && git rm -rf --ignore-unmatch ${{ github.event.number }} && cd ..
mkdir -p ./demo/${{ github.event.number }}
cp -R storybook-static/* ./demo/${{ github.event.number }}/
cd demo && git add .
- name: Commit demo for gh-pages
uses: actions-js/push@156f2b10c3aa000c44dbe75ea7018f32ae999772 #v1.4
with:
directory: "./demo"
github_token: ${{ secrets.GITHUB_TOKEN }}
message: "doc: update demo from ${{ github.event.number }}"
branch: gh-pages
- name: Find Comment
uses: peter-evans/find-comment@v2
id: fc
with:
issue-number: ${{ github.event.number }}
body-includes: Storybook for this PR deployed on this
- name: Create comment
uses: peter-evans/create-or-update-comment@c6c9a1a66007646a28c153e2a8580a5bad27bcfa #v3.0.2
if: steps.fc.outputs.comment-id == ''
with:
issue-number: ${{ github.event.number }}
body: |
Storybook for this PR deployed on this [github page](https://legendary-chainsaw-woo3ynm.pages.github.io/${{ github.event.number }})