-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (41 loc) · 1.28 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
on: [push, pull_request]
name: deploy
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- id: cache-modules
uses: actions/cache@v1
with:
path: node_modules
key: ${{ matrix.node-version }}-${{ runner.OS }}-build-${{ hashFiles('package.json', 'yarn.lock') }}
- if: steps.cache-modules.outputs.cache-hit != 'true'
run: yarn
# - name: test
# run: yarn test
publish:
name: publish
needs: test
runs-on: ubuntu-latest
if: github.event_name == 'push' && ( github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' )
steps:
- uses: actions/checkout@v2
- id: cache-modules
uses: actions/cache@v1
with:
path: node_modules
key: ${{ matrix.node-version }}--${{ runner.OS }}-build-${{ hashFiles('package.json', 'yarn.lock') }}
- if: steps.cache-modules.outputs.cache-hit != 'true'
run: yarn
- run: yarn build
- run: npx release-it
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}