forked from maplibre/maplibre-gl-js
-
Notifications
You must be signed in to change notification settings - Fork 1
49 lines (41 loc) · 1.34 KB
/
add-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
name: Add PR Demo
on:
pull_request:
types: [opened, synchronize]
jobs:
add-pr-demo:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set-up node
uses: actions/setup-node@v2
with:
node-version: 16
- name: Build
run: |
npm ci
npm run build-prod
npm run build-csp
npm run build-dev
npm run build-css
npm run build-benchmarks
npm run generate-typings
cp test/integration/pr-demo/index.html dist/index.html
- name: Empty postinstall.js
run: |
echo "// empty in published package" > postinstall.js
- name: Write dist/package.json
run: |
echo "{ \"type\": \"commonjs\" }" > dist/package.json
- name: Deploy
uses: JamesIves/github-pages-deploy-action@4.1.0
with:
branch: gh-pages
folder: dist
target-folder: pulls/${{ github.event.number }}
- name: Add comment
uses: marocchino/sticky-pull-request-comment@v2
with:
header: pr-demo
message: |
Uploaded [build output](https://github.com/wipfli/maplibre-gl-js/tree/gh-pages/pulls/${{ github.event.number }}) and created a [live demo](https://maplibre.org/maplibre-gl-js/pulls/${{ github.event.number }}).