Skip to content

Commit 61a22c0

Browse files
authored
Merge pull request #359 from jsonresume/add-cd
Use GH Actions for CI/CD
2 parents b5aade8 + 9b6091b commit 61a22c0

File tree

2 files changed

+73
-0
lines changed

2 files changed

+73
-0
lines changed

.github/workflows/latest.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Latest
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
verify:
10+
name: Verify
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
node: [10, 12]
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v1
18+
- name: Setup
19+
uses: actions/setup-node@v1
20+
with:
21+
node-version: ${{ matrix.node }}
22+
- name: Cache
23+
uses: actions/cache@v1
24+
with:
25+
path: node_modules
26+
key: ${{ runner.OS }}-npm-cache-${{ hashFiles('**/package-lock.json') }}
27+
restore-keys: |
28+
${{ runner.OS }}-npm-cache-
29+
- name: Install
30+
run: npm ci
31+
- name: Test
32+
run: npm t

.github/workflows/release.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
check:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
node: [10, 12]
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@master
17+
- name: Setup
18+
uses: actions/setup-node@v1
19+
with:
20+
node-version: ${{ matrix.node }}
21+
- name: Cache
22+
uses: actions/cache@v1
23+
with:
24+
path: node_modules
25+
key: ${{ runner.OS }}-npm-cache-${{ hashFiles('**/package-lock.json') }}
26+
restore-keys: |
27+
${{ runner.OS }}-npm-cache-
28+
- name: Verify
29+
run: |
30+
npm ci
31+
npm t
32+
npm:
33+
runs-on: ubuntu-latest
34+
needs: check
35+
steps:
36+
- name: Checkout
37+
uses: actions/checkout@master
38+
- name: Publish
39+
run: |
40+
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_AUTH_TOKEN }}" > ~/.npmrc
41+
npm publish --access public

0 commit comments

Comments
 (0)