-
Notifications
You must be signed in to change notification settings - Fork 1
57 lines (52 loc) · 1.5 KB
/
pipeline.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
name: Deployment Pipeline
on:
workflow_dispatch:
push:
branches: ["main"]
tags:
- "v*"
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- name: Setup Node.js environment
uses: actions/[email protected]
with:
node-version-file: .nvmrc
- name: Install dependencies
run: npm ci
- name: Run service tests
run: npm -w src/service test
- name: Run plugin tests
run: npm -w src/plugin test --watch=false --coverage
publish-service:
runs-on: ubuntu-latest
needs: test
if: startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/[email protected]
with:
fetch-depth: 2
- name: Setup Node.js environment
uses: actions/[email protected]
with:
node-version-file: .nvmrc
registry-url: "https://registry.npmjs.org"
- name: Install dependencies
run: npm ci
- name: Build sources
run: npm -w src/service run build
- name: Check for changes in service directory
id: check-changes
run: |
if git diff --quiet HEAD^ HEAD -- ./src/service/; then
echo "::set-output name=changed::false"
else
echo "::set-output name=changed::true"
fi
- name: Publish package
if: steps.check-changes.outputs.changed == 'true'
run: npm -w src/service publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}