-
-
Notifications
You must be signed in to change notification settings - Fork 5
42 lines (35 loc) · 1.02 KB
/
cd.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
name: 🌐 CD
on:
push:
pull_request:
pull_request_review:
types: [submitted]
jobs:
publish_to_pkg_pr_new:
runs-on: ubuntu-latest
timeout-minutes: 2
if: |
github.event_name != 'push' ||
!contains(github.event.head_commit.message, 'chore: release')
steps:
- name: Bail early if PR is from a fork and not approved
if: |
github.event_name == 'pull_request_review' &&
github.event.pull_request.head.repo.fork == true &&
github.event.review.state != 'approved'
run: |
echo "PR from fork is not approved. Skipping workflow."
exit 78
- name: ⬇️ Checkout repo
uses: actions/checkout@v4
- name: ⎔ Setup node
uses: actions/setup-node@v4
with:
cache: npm
node-version-file: '.nvmrc'
- name: 📥 Install deps
run: npm install
- name: 🛠️ Build
run: npm run build
- name: ⚡ pkg.pr.new
run: npx --yes pkg-pr-new publish --compact