-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (41 loc) · 1.23 KB
/
deploy.yaml
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: Build and deploy Rust server
on:
workflow_dispatch:
push:
branches: [main]
jobs:
deploy_rust:
runs-on: ubuntu-latest
container: rust:slim-buster
env:
SQLX_OFFLINE: true
steps:
- uses: actions/checkout@v2
- name: Install Dependencies
run: |
apt-get update
apt-get install -y libssl-dev pkg-config
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Build Rust
run: cargo build --release --manifest-path ./apps/rust-backend/Cargo.toml
- name: Copy file via scp
uses: appleboy/scp-action@v0.1.7
with:
host: ${{ secrets.IP }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }}
source: "apps/rust-backend/target/release/rust-backend"
target: "~/apps/next-rust-todolist/apps/rust-backend/target/release/"
strip_components: 4
- uses: appleboy/ssh-action@v1.0.0
with:
host: ${{ secrets.IP }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }}
script: |
cd apps/next-rust-todolist
git checkout .
git pull
docker-compose up -d --build