-
-
Notifications
You must be signed in to change notification settings - Fork 26
56 lines (47 loc) · 1.41 KB
/
main.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
name: Build & Publish
on:
push:
tags:
- 'v*'
branches:
- 'next*'
pull_request:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Use Node.js 13.x
uses: actions/setup-node@master
with:
node-version: 13.x
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: yarn
- name: Build
run: yarn build
# Publish with STABLE
- name: Publish NPM latest
if: startsWith(github.ref, 'refs/tags/v') # run only with tag
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
# Publish with NEXT tag
- name: Publish NPM next!
if: github.ref == 'refs/heads/next' # run only with NEXT branch
run: npm publish --tag next
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
# Deploy Github Pages (only with v* tag)
- name: Prepare Github Pages
if: startsWith(github.ref, 'refs/tags/v') # run only with tag
run: cp -r dist/ demo/dist/
- name: Deploy Github Pages
if: startsWith(github.ref, 'refs/tags/v') # run only with tag
uses: peaceiris/actions-gh-pages@v2
env:
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
PUBLISH_BRANCH: gh-pages
PUBLISH_DIR: ./demo