-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (44 loc) · 1.35 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
51
52
name: Build | Deploy
run-name: Deploy to remote tencent server
env:
RELEASE_BUILD: "target/release/college-student-pe-score"
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
on:
push:
tags:
- v*.*.*
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Restore dependencies and build 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: Run sccache-cache
uses: mozilla-actions/[email protected]
- name: Setup Rust
uses: ATiltedTree/[email protected]
with:
rust-version: nightly
- name: Gather dependencies | Build
run: cargo build --release
- name: Deploy to remote tencent server
uses: wlixcc/[email protected]
with:
username: ${{ vars.USERNAME }}
server: ${{ secrets.SERVER_IP }}
ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }}
local_path: ${{ env.RELEASE_BUILD }}
remote_path: ${{ vars.REMOTE_PATH }}
delete_remote_files: true
sftpArgs: "-o ConnectTimeout=5"