-
Notifications
You must be signed in to change notification settings - Fork 0
34 lines (29 loc) · 943 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
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 }}
script: |
ls
cd /home/hnr/pawnpawnpwn
# 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/hnr/.nvm/versions/node/v20.10.0/bin"
killall node || true # Force return true so exit code is not 1
yarn install
nohup yarn start > nodemon.out 2> nodemon.err < /dev/null &