Build & Deploy Server #11
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 & |