-
Notifications
You must be signed in to change notification settings - Fork 272
71 lines (56 loc) · 2.25 KB
/
ci-pr.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
name: Build PR-Preview
on:
pull_request_review:
types: submitted
permissions:
contents: write
pages: write
id-token: write
concurrency:
group: ${{github.workflow}}-${{github.ref}}
cancel-in-progress: true
env:
LAYOUT_EDITOR_BASE_URL: "/EmbeddedChat/pulls/pr-${{github.event.pull_request.number}}/layout_editor"
DOCS_BASEURL: "/EmbeddedChat/pulls/pr-${{github.event.pull_request.number}}/docs"
jobs:
build:
if: github.event.review.state == 'approved' && (github.event.review.author_association == 'COLLABORATOR' || github.event.review.author_association == 'OWNER')
runs-on: ubuntu-latest
outputs:
pr_number: ${{ steps.set_pr_number.outputs.pr_number }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "16.19.0"
- name: Install Dependencies
run: yarn install
- name: Build packages
run: yarn build && yarn build:storybook
- name: Setup Node.js for Docs
uses: actions/setup-node@v4
with:
node-version: "18.x"
- name: "Install dependencies for docs"
run: yarn install
working-directory: packages/docs/
- name: Build Docs
run: yarn build
working-directory: packages/docs/
- name: Prepare Build Folder
run: |
mkdir -p build/pulls/pr-${{github.event.pull_request.number}}/
mkdir -p build/pulls/pr-${{github.event.pull_request.number}}/ui-elements
mkdir -p build/pulls/pr-${{github.event.pull_request.number}}/layout_editor
mkdir -p build/pulls/pr-${{github.event.pull_request.number}}/docs
mv -v packages/react/storybook-static/* build/pulls/pr-${{github.event.pull_request.number}}/
mv -v packages/ui-elements/storybook-static/* build/pulls/pr-${{github.event.pull_request.number}}/ui-elements/
mv -v packages/layout_editor/dist/* build/pulls/pr-${{github.event.pull_request.number}}/layout_editor/
mv -v packages/docs/build/* build/pulls/pr-${{github.event.pull_request.number}}/docs/
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: github-pages
path: build/