-
Notifications
You must be signed in to change notification settings - Fork 2
66 lines (57 loc) · 2.29 KB
/
pull_request.yml
File metadata and controls
66 lines (57 loc) · 2.29 KB
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
name: Run on PRs
on:
pull_request:
types: [opened, closed, synchronize]
permissions:
deployments: write # allow creating deployments
pull-requests: write # allow commenting on PRs
contents: read # minimal read access to repo, if needed
jobs:
build:
runs-on: depot-ubuntu-latest
env:
PUBLIC_POSTHOG_KEY: ${{ secrets.PUBLIC_POSTHOG_KEY }}
PUBLIC_POSTHOG_HOST: ${{ secrets.PUBLIC_POSTHOG_HOST }}
ZE_PUBLIC_ENABLED_LANDERS: ${{ vars.ZE_PUBLIC_ENABLED_LANDERS || '' }}
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Set up Node.js
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
with:
node-version: '24'
- name: Setup pnpm
uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4
with:
version: 10.32.1
run_install: false
- name: Install dependencies
run: pnpm i
- name: Run build for non-merged PR
if: github.event.action != 'closed' && github.event.pull_request.merged != true
id: build_non_merge
env:
ZE_SECRET_TOKEN: ${{ secrets.ZEPHYR_AUTH_TOKEN }}
run: |
OUTPUT=$(pnpm run build)
echo "$OUTPUT"
URL=$(echo "$OUTPUT" | grep -oE 'https://[^ ]+' | grep 'zephyr-cloud\.io' | tail -n1)
VERSION=$(echo "$OUTPUT" | grep -oP 'ZEPHYR\s+\K\S+(?=#)')
echo "Extracted Zephyr URL: $URL"
echo "Extracted VERSION: $VERSION"
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
echo "url=$URL" >> "$GITHUB_OUTPUT"
OUTPUT=$(pnpm run build)
- name: Run build for merged PR on main or development
if: github.event.pull_request.merged == true &&
github.event.action == 'closed' &&
(github.event.pull_request.base.ref == 'main' || github.event.pull_request.base.ref == 'development')
id: build_merge
env:
ZE_SECRET_TOKEN: ${{ secrets.ZEPHYR_AUTH_TOKEN }}
run: pnpm run build
- name: Zephyr deploy summary
uses: ZephyrCloudIO/zephyr-preview-environment-action@30036a8a1c2031c4f6c6706d2cbc1a9b48466ae2 # main
id: zephyr-summary
with:
github_token: ${{ secrets.GITHUB_TOKEN }}