-
-
Notifications
You must be signed in to change notification settings - Fork 24
62 lines (51 loc) · 1.66 KB
/
rust.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
name: Rust deploy
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: Swatinem/[email protected]
# - name: Build
# run: cargo build --verbose
- name: Run releases
run: cargo build --release
- name: Deploy release
uses: appleboy/scp-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.SSH_KEY }}
source: "./target/release"
target: ${{ secrets.RUST_TARGET_PATH }}
- name: Deploy files
uses: appleboy/scp-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.SSH_KEY }}
source: "./public,./resources"
target: ${{ secrets.RUST_DEPLOY_PATH }}
- name: restart service
uses: appleboy/[email protected]
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.SSH_KEY }}
script: |
sudo systemctl stop avored.service
sudo systemctl start avored.service
# - name: change file ownership
# uses: appleboy/[email protected]
# with:
# host: ${{ secrets.HOST }}
# username: ${{ secrets.USERNAME }}
# key: ${{ secrets.SSH_KEY }}
# port: ${{ secrets.PORT }}
# script: sudo chown -R www-data:www-data ${{ secrets.RUST_TARGET_PATH}}