-
Notifications
You must be signed in to change notification settings - Fork 47
91 lines (88 loc) · 2.44 KB
/
push.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
on:
push:
branches:
- master
name: Build and Publish
jobs:
build:
if: "!contains(github.event.head_commit.message, 'no-ci')"
name: Build Library
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/setup-node@v1
with:
node-version: 16.18.1
- uses: actions/cache@v1
id: cache-modules
with:
path: node_modules
key: ${{ runner.OS }}-build-${{ hashFiles('package.json') }}
- run: yarn install --pure-lockfile
if: steps.cache-modules.outputs.cache-hit != 'true'
- run: yarn build
- run: yarn test
- run: yarn test:badges
- name: Upload esm build artifact
uses: actions/upload-artifact@v2
with:
name: build-esm
path: esm
- name: Upload lib build artifact
uses: actions/upload-artifact@v2
with:
name: build-lib
path: lib
deploy:
needs: build
name: Deploy Library
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/setup-node@v1
with:
node-version: 16.18.1
- uses: actions/cache@v1
id: cache-modules
with:
path: node_modules
key: ${{ runner.OS }}-build-${{ hashFiles('package.json') }}
- name: Download build-lib
uses: actions/download-artifact@v2
with:
name: build-lib
path: lib
- name: Download build-esm
uses: actions/download-artifact@v2
with:
name: build-esm
path: esm
- name: Deploy to NPM! 🚀
uses: Github-Actions-Community/merge-release@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
demo:
needs: build
name: Deploy Demo
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/setup-node@v1
with:
node-version: 16.18.1
- uses: actions/cache@v1
id: cache-modules
with:
path: node_modules
key: ${{ runner.OS }}-build-${{ hashFiles('package.json') }}
- run: yarn build-for-demo
- run: yarn build
working-directory: ./demo
- name: Deploy 🚀
if: github.ref == 'refs/heads/master'
uses: JamesIves/github-pages-deploy-action@releases/v3
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages # The branch the action should deploy to.
FOLDER: demo/build # The folder the action should deploy.