-
Notifications
You must be signed in to change notification settings - Fork 21
67 lines (65 loc) · 1.68 KB
/
ci.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
name: CI
on:
push:
branches:
- develop
- stable
pull_request:
types:
- 'synchronize'
- 'opened'
branches:
- '**'
jobs:
build-and-test:
name: Build and Test (Node ${{ matrix.node }})
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
matrix:
node:
- 20.x
- 18.x
- 16.x
steps:
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- uses: actions/checkout@v3
- name: Restore Dependency Cache
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.OS }}-dependency-cache-${{ hashFiles('**/package.json') }}
- run: npm install
- run: npm run lint
- run: npm run build
- run: npm test
deploy:
name: Deploy
runs-on: ubuntu-latest
if: ${{ github.ref == 'refs/heads/stable' }}
timeout-minutes: 30
needs:
- build-and-test
steps:
- run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >> ~/.npmrc
- uses: actions/setup-node@v3
with:
node-version: 16.x
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Restore Dependency Cache
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.OS }}-dependency-cache-${{ hashFiles('**/package.json') }}
- run: npm install
- run: npm run publish:ci
env:
GH_TOKEN: ${{ secrets.IONITRON_GITHUB_TOKEN }}
GIT_AUTHOR_NAME: Ionitron
GIT_AUTHOR_EMAIL: [email protected]
GIT_COMMITTER_NAME: Ionitron
GIT_COMMITTER_EMAIL: [email protected]