forked from synapsecns/explorer-api
-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (36 loc) · 934 Bytes
/
Copy pathdeploy-master.yml
File metadata and controls
42 lines (36 loc) · 934 Bytes
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
name: deploy master
on:
push:
branches:
- master
jobs:
cicd:
runs-on: ubuntu-latest
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: npm test
run: npm test
env:
NODE_ENV: test
MONGO_URI: ${{ secrets.MONGO_URI }}
REDIS_URI: ${{ secrets.REDIS_URI }}
- name: deploy on machine via ssh
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }}
port: ${{ secrets.PORT }}
script: |
cd /root/explorer-api
git reset --hard HEAD
git pull origin master
npm i
pm2 restart index.js