-
Notifications
You must be signed in to change notification settings - Fork 63
65 lines (52 loc) · 1.58 KB
/
preview.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
name: 'Preview'
# pkg.pr.new won't publish anything to NPM; instead,
# it leverages its own URLs, which are npm-compatible.
# npm install https://pkg.pr.new/${owner}/${repo}/${package}@${commit}
# learn more: https://github.com/stackblitz-labs/pkg.pr.new/blob/main/README.md
on:
push:
paths:
- 'packages/**'
pull_request:
paths:
- 'packages/**'
workflow_dispatch:
concurrency:
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
defaults:
run:
shell: bash
env:
ACTIONS_RUNNER_DEBUG: true
NEXT_TELEMETRY_DISABLED: '1'
ASTRO_TELEMETRY_DISABLED: '1'
NODE_OPTIONS: '--no-warnings'
jobs:
preview:
name: 'Preview'
runs-on: ['ubuntu-latest']
# if pr is not from maintaner, require review approval
steps:
- name: 'Checkout'
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: 'Get pnpm Version'
id: pnpm-version
run: |
PNPM_VERSION=$(cat package.json | jq --raw-output '.packageManager' | awk -F'@' '{print $2}')
echo "PNPM_VERSION=$PNPM_VERSION" >> $GITHUB_OUTPUT
- name: 'Setup pnpm'
uses: pnpm/action-setup@v4
with:
version: ${{ steps.pnpm-version.outputs.PNPM_VERSION }}
- name: 'Setup Node.js'
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
cache: 'pnpm'
- name: 'Install Dependencies'
run: pnpm install
- name: 'Publish Previews'
run: pnpm dlx pkg-pr-new publish --no-template --compact ./packages/*