-
Notifications
You must be signed in to change notification settings - Fork 3
74 lines (63 loc) · 1.57 KB
/
Copy pathci.yml
File metadata and controls
74 lines (63 loc) · 1.57 KB
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
68
69
70
71
72
73
74
name: pipeline
on:
pull_request:
push:
branches:
- 'master'
jobs:
test:
runs-on: ${{ matrix.platform }}
strategy:
matrix:
node-version:
- 16.16.x
platform:
- ubuntu-latest
services:
mongo:
image: mongo:latest
ports:
- 27017:27017
redis:
image: redis:latest
ports:
- 6379:6379
steps:
- name: checkout code
uses: actions/checkout@v2
- name: setup node env
uses: actions/setup-node@v2
with:
node-version: 16.x
- name: npm install
run: npm install
- name: Setup .env for test
run: |
cp .env.sample .env.test
echo $'\nTEST=true' >> .env.test
- name: run tests w coverage
run: npm run test:coverage
- name: Upload test coverage
run: |
curl -Os https://uploader.codecov.io/latest/linux/codecov
chmod +x codecov
./codecov
deploy:
runs-on: ubuntu-latest
needs: test
if: github.ref == 'refs/heads/master'
steps:
- name: deploy on machine via ssh
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.DEPLOY_HOST }}
username: ${{ secrets.DEPLOY_USERNAME }}
key: ${{ secrets.DEPLOY_KEY }}
port: ${{ secrets.DEPLOY_PORT }}
script: |
cd /root/synapse-analytics-api
git reset --hard HEAD
git pull origin master
npm i
npm run build
pm2 restart dist/index.js