-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (37 loc) · 943 Bytes
/
deployment.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: Deploy
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Add to known hosts
run: |
mkdir -p ~/.ssh/known_hosts
cp known_hosts ~/.ssh/known_hosts
- name: SSH
uses: appleboy/[email protected]
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USER }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
port: 22
script: |
cd mari-arena
git stash
git pull origin main
source ~/.profile
source ~/.nvm/nvm.sh
nvm use v20.9.0
cd server
go mod tidy
go build .
pm2 restart mari-arena-server
cd ../web
npm install
npm run build
pm2 restart mari-arena-frontend