-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (48 loc) · 1.31 KB
/
deploy.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
name: Deploy
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
- name: Restore cache
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Build project
run: |
cargo build --release
- name: Archive production artifacts
uses: actions/upload-artifact@v3
with:
name: gameserver-release-binary
path: target/release/gameserver
upload:
runs-on: ubuntu-latest
needs: build
steps:
- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: gameserver-release-binary
- name: Upload binary via SSH
uses: appleboy/scp-action@master
with:
host: ${{ vars.DEPLOY_HOST }}
username: ${{ vars.DEPLOY_USERNAME }}
key: ${{ secrets.DEPLOY_KEY }}
source: gameserver
target: ${{ vars.DEPLOY_PATH }}