-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (65 loc) · 2.07 KB
/
build_server.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: Build & Deploy Server
on:
workflow_dispatch:
jobs:
KillSocialServer:
name: Kill Social Server
runs-on: ubuntu-latest
steps:
- name: Executing killall -q gcgd-social-server
uses: appleboy/[email protected]
with:
host: ${{ secrets.VPS_HOST }}
username: ${{ secrets.VPS_USERNAME }}
port: ${{ secrets.VPS_PORT }}
key: ${{ secrets.VPS_KEY }}
script: killall -q gcgd-social-server
BuildAndDeploy:
needs: KillSocialServer
name: Build & Deploy
runs-on: ubuntu-latest
strategy:
matrix:
platform: [Linux]
steps:
- uses: actions/checkout@v2
with:
lfs: true
- name: Build
id: build
uses: manleydev/build-godot-action@f759ed7f8fcb5137cb70873ecf663aa8a1bd998b
with:
name: gcgd-social-server
preset: ${{ matrix.platform }}
debugMode: "false"
projectDir: gcgd-social-server
- name: Copy File to VPS
uses: appleboy/[email protected]
with:
host: ${{ secrets.VPS_HOST }}
username: ${{ secrets.VPS_USERNAME }}
port: ${{ secrets.VPS_PORT }}
key: ${{ secrets.VPS_KEY }}
source: ${{ github.workspace }}/${{ steps.build.outputs.build }}/gcgd-social-server
target: /home/${{ secrets.VPS_USERNAME }}
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: gcgd-social-server
path: ${{ github.workspace }}/${{ steps.build.outputs.build }}
StartSocialServer:
needs: [KillSocialServer, BuildAndDeploy]
name: Start Social Server
runs-on: ubuntu-latest
steps:
- name: Starting Server
uses: appleboy/[email protected]
with:
host: ${{ secrets.VPS_HOST }}
username: ${{ secrets.VPS_USERNAME }}
port: ${{ secrets.VPS_PORT }}
key: ${{ secrets.VPS_KEY }}
script: |
cd ~/github/workspace/build
chmod +x gcgd-social-server
nohup ./gcgd-social-server > /dev/null 2>&1 &