-
Notifications
You must be signed in to change notification settings - Fork 5
55 lines (44 loc) · 1.14 KB
/
deploy.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
name: CD
on:
push:
branches:
- main
jobs:
check:
name: Check package.json version
runs-on: ubuntu-latest
outputs:
changed: ${{ steps.check.outputs.changed }}
steps:
- name: Checkout repo
uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'
- name: Check version
id: check
uses: EndBug/version-check@v2
with:
file-url: https://unpkg.com/@pooltogether/hooks@latest/package.json
static-checking: localIsNew
deploy:
name: Deploy new package version to NPM
runs-on: ubuntu-latest
needs: check
if: needs.check.outputs.changed == 'true'
steps:
- name: Checkout repo
uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'
- name: Install
run: yarn
- name: Lint
run: yarn lint
- name: Publish
run: yarn publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_KEY }}