-
-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (44 loc) · 1.28 KB
/
cd.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: cd
on:
workflow_run:
workflows: ["ci"]
types:
- completed
branches:
- 'master'
jobs:
deploy:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
- name: Build Binary
id: build
run: |
cargo build --release
- name: rsync
if: ${{ steps.build.outcome == 'success' }}
uses: contention/[email protected]
with:
flags: -vP
excludes:
user: ${{ secrets.DEPLOY_USERNAME }}
host: ${{ secrets.DEPLOY_HOST }}
localpath: target/release/isac-rs
remotepath: ${{ secrets.DEPLOY_PATH }}
deploy_key: ${{ secrets.DEPLOY_SSH_KEY }}
- name: restart service
if: ${{ steps.build.outcome == 'success' }}
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.DEPLOY_HOST }}
username: ${{ secrets.DEPLOY_USERNAME }}
key: ${{ secrets.DEPLOY_SSH_KEY }}
script: |
git pull # sync templates
systemctl --user restart isac