-
Notifications
You must be signed in to change notification settings - Fork 0
35 lines (30 loc) · 991 Bytes
/
backend.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
name: Backend CI/CD
on:
push:
branches: [ "main" ]
paths:
- backend/**
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Deploy to Digital Ocean droplet via SSH action
uses: appleboy/[email protected]
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USERNAME }}
key: ${{ secrets.SSH_KEY }}
passphrase: ${{ secrets.SSH_PASSPHRASE }}
script: |
ls
cd /home/yuna/attention
# Pull from git repo
git checkout main || true # Force return true so exit code is not 1
git pull
# Backend CD
cd backend
export PATH="$PATH:/home/yuna/.nvm/versions/node/v18.13.0/bin"
killall node || true # Force return true so exit code is not 1
yarn install
nohup yarn prod > nohup.out 2> nohup.err < /dev/null &