-
Notifications
You must be signed in to change notification settings - Fork 57
41 lines (36 loc) · 1.02 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
name: ci
on: push
jobs:
ci:
runs-on: ubuntu-latest
env:
PORT: 3000
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v2
- name: ⎔ Setup node
uses: actions/setup-node@v2
with:
node-version: "16.14.0"
cache: npm
- name: 📥 Download deps
run: npm i --legacy-peer-deps
- name: 🧪 Run test script
run: npm test
deploy:
if: ${{ false }} # disable for now
needs: ci
runs-on: ubuntu-latest
steps:
- uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USERNAME }}
key: ${{ secrets.SSH_KEY }}
port: ${{ secrets.SSH_PORT }}
script: |
cd ~/template-backend
git reset --hard origin/main
git pull https://${{ secrets.CLONE_TOKEN }}@github.com/robotics-4-all/template-backend main
bash -ci 'npm i --legacy-peer-deps'
bash -ci 'pm2 restart server'