-
Notifications
You must be signed in to change notification settings - Fork 4
57 lines (47 loc) · 1.27 KB
/
packages-react.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
name: packages/react
on:
push:
branches: [master]
paths:
- "packages/react/**"
- ".github/workflows/**"
pull_request:
branches: [master]
paths:
- "packages/react/**"
- ".github/**"
jobs:
build:
runs-on: ubuntu-latest
env:
directory: ./packages/react
NPM_TOKEN: ${{secrets.NPM_TOKEN}}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup node
uses: actions/setup-node@v1
- name: Cache deps
uses: actions/cache@v1
with:
path: ~/.npm
key: deps-${{ hashFiles('${{env.directory}}/package-lock.json') }}
restore-keys: |
deps-
- name: Install Dependencies
run: npm i
working-directory: ${{env.directory}}
- name: Build
run: npm run build
working-directory: ${{env.directory}}
# - name: Run Tests
# run: npm run test
# working-directory: ${{env.directory}}
- name: NPM Auth
run: echo //registry.npmjs.org/:_authToken=${NPM_TOKEN} >> .npmrc
working-directory: ${{env.directory}}
- name: Publish
if: github.ref == 'refs/heads/master'
run: npm publish || true
working-directory: ${{env.directory}}