Skip to content

Commit 4092705

Browse files
committed
chore: add github actions ci
1 parent 7a93fcc commit 4092705

File tree

2 files changed

+76
-0
lines changed

2 files changed

+76
-0
lines changed

.github/workflows/nodejs.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Node CI
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
8+
runs-on: ubuntu-latest
9+
10+
strategy:
11+
matrix:
12+
node-version: [8.x, 10.x, 12.x]
13+
14+
steps:
15+
- uses: actions/checkout@v1
16+
- name: Use Node.js ${{ matrix.node-version }}
17+
uses: actions/setup-node@v1
18+
with:
19+
node-version: ${{ matrix.node-version }}
20+
- name: npm install, build, and test
21+
run: |
22+
npm i -g yarn
23+
yarn install
24+
yarn test
25+
env:
26+
CI: true
27+
REACT_APP_PUBLIC_KEY: ${{ secrets.ik_public_key }}
28+
REACT_APP_PRIVATE_KEY: ${{ secrets.ik_private_key }}
29+
REACT_APP_URL_ENDPOINT: ${{ secrets.ik_url_endopint }}

.github/workflows/npmpublish.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Publish
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
8+
jobs:
9+
build:
10+
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
matrix:
15+
node-version: [8.x, 10.x, 12.x]
16+
17+
steps:
18+
- uses: actions/checkout@v1
19+
- name: Use Node.js ${{ matrix.node-version }}
20+
uses: actions/setup-node@v1
21+
with:
22+
node-version: ${{ matrix.node-version }}
23+
- name: npm install, build, and test
24+
run: |
25+
npm i -g yarn
26+
yarn install
27+
yarn test
28+
env:
29+
CI: true
30+
31+
publish:
32+
needs: build
33+
runs-on: ubuntu-latest
34+
steps:
35+
- uses: actions/checkout@v1
36+
- uses: actions/setup-node@v1
37+
with:
38+
node-version: 12
39+
registry-url: https://registry.npmjs.org/
40+
- name: yarn publish
41+
run: |
42+
npm i -g yarn
43+
yarn config set //registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN
44+
yarn publish
45+
env:
46+
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
47+
CI: true

0 commit comments

Comments
 (0)