forked from 99x/serverless-dynamodb-local
-
Notifications
You must be signed in to change notification settings - Fork 6
52 lines (50 loc) · 1.32 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
name: CI/CD
on: push
jobs:
ci:
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
matrix:
node-version: [lts/*, current]
env:
CI: true
steps:
- name: Checkout ${{ github.sha }}
uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
registry-url: https://registry.npmjs.org/
- name: Install dependencies
run: npm ci
- name: Lint
run: npm run lint --if-present
- name: Build
run: npm run build --if-present
- name: Test
run: npm run test --if-present
cd:
if: startsWith(github.ref, 'refs/tags/v')
needs: ci
runs-on: ubuntu-latest
timeout-minutes: 10
env:
CI: true
steps:
- name: Checkout ${{ github.sha }}
uses: actions/checkout@v3
- name: Use Node.js with the npmjs.org registry
uses: actions/setup-node@v3
with:
node-version: lts/*
registry-url: https://registry.npmjs.org/
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build --if-present
- name: Publish ${{ github.ref }}
run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}