-
Notifications
You must be signed in to change notification settings - Fork 55
88 lines (76 loc) · 2.72 KB
/
pr-playground.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
name: PR playground CI
on:
pull_request:
push:
branches: [master]
# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true
permissions:
contents: read
deployments: read
pull-requests: write # needed to write comment in PR
statuses: write
jobs:
build:
runs-on: ubuntu-latest
name: Build and deploy playground
environment: pull_request_unsafe
steps:
- name: Checkout sources
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 #v3.6.0
- name: Use Node.js
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
with:
node-version: 18
registry-url: "https://registry.npmjs.org/"
scope: "@talend"
cache: "yarn"
- name: Install and build playground
id: build
run: |
yarn install --frozen-lockfile
yarn global add surge
echo "$(yarn global bin)" >> $GITHUB_PATH
yarn pre-release
yarn workspace @talend/ui-playground run test:demo:umd
- name: deploy if master
if: github.ref == 'refs/heads/master'
run: |
rm -rf .static
mkdir .static
mkdir .static/playground
cp -R packages/playground/dist/* .static/playground
surge --project .static --domain "talend-playground.surge.sh"
env:
SURGE_LOGIN: ${{ secrets.SURGE_LOGIN }}
SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }}
- name: deploy if PR
if: github.ref != 'refs/heads/master'
run: |
rm -rf .static
mkdir .static
mkdir .static/playground
cp -R packages/playground/dist/* .static/playground
surge --project .static --domain "${{ github.event.number }}.talend-playground.surge.sh"
env:
SURGE_LOGIN: ${{ secrets.SURGE_LOGIN }}
SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }}
check:
runs-on: ubuntu-latest
name: Check size
environment: pull_request_unsafe
steps:
- name: Checkout sources
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 #v3.6.0
- name: Check UMD files size diff
uses: preactjs/compressed-size-action@8119d3d31b6e57b167e09c81dfa877eada3bcb35 #v2.5.0
if: github.ref != 'refs/heads/master'
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
build-script: "pre-release"
pattern: "./packages/*/dist/*.{js,css,json}"
exclude: "{**/*.html,**/*.map,**/node_modules/**}"
compression: "none"
minimum-change-threshold: 100