4
4
push :
5
5
tags :
6
6
- ' v*'
7
+ branches :
8
+ - ' next*'
9
+ pull_request :
10
+ branches :
11
+ - master
7
12
8
13
jobs :
9
14
build :
@@ -17,38 +22,33 @@ jobs:
17
22
node-version : 13.x
18
23
registry-url : ' https://registry.npmjs.org'
19
24
20
- - name : Install dependencies # Install all deps
25
+ - name : Install dependencies
21
26
run : yarn
22
27
23
28
- name : Build
24
29
run : yarn build
25
30
26
- - name : Publish NPM
31
+ # Publish with STABLE
32
+ - name : Publish NPM latest
33
+ if : startsWith(github.ref, 'refs/tags/v') # run only with tag
27
34
run : npm publish
28
35
env :
29
36
NODE_AUTH_TOKEN : ${{ secrets.NPM_AUTH_TOKEN }}
30
37
31
- # Publish to GitHub Package Registry
32
- # - name: Set up package for GPR
33
- # run: yarn gpr:setup
34
-
35
- # - name: Use GPR
36
- # uses: actions/setup-node@master
37
- # with:
38
- # node-version: 13
39
- # registry-url: https://npm.pkg.github.com/
40
- # scope: '@bartholomej'
41
-
42
- # - name: Publish to GitHub Package Registry
43
- # run: |
44
- # npm publish
45
- # env:
46
- # NODE_AUTH_TOKEN: ${{github.token}}
38
+ # Publish with NEXT tag
39
+ - name : Publish NPM next!
40
+ if : github.ref == 'refs/heads/next' # run only with NEXT branch
41
+ run : npm publish --tag next
42
+ env :
43
+ NODE_AUTH_TOKEN : ${{ secrets.NPM_AUTH_TOKEN }}
47
44
45
+ # Deploy Github Pages (only with v* tag)
48
46
- name : Prepare Github Pages
47
+ if : startsWith(github.ref, 'refs/tags/v') # run only with tag
49
48
run : cp -r dist/ demo/dist/
50
49
51
50
- name : Deploy Github Pages
51
+ if : startsWith(github.ref, 'refs/tags/v') # run only with tag
52
52
uses : peaceiris/actions-gh-pages@v2
53
53
env :
54
54
ACTIONS_DEPLOY_KEY : ${{ secrets.ACTIONS_DEPLOY_KEY }}
0 commit comments