Skip to content

Commit dd64fec

Browse files
committed
FEAT: Workflows and containers list route
0 parents  commit dd64fec

5 files changed

Lines changed: 2043 additions & 0 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Deploy API Rust
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build-and-deploy:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v3
15+
16+
- name: Install Rust
17+
uses: actions-rs/toolchain@v1
18+
with:
19+
toolchain: stable
20+
override: true
21+
22+
- name: Build release
23+
run: cargo build --release
24+
25+
- name: Deploy to VPS
26+
uses: appleboy/scp-action@v0.1.3
27+
with:
28+
host: ${{ secrets.VPS_HOST }}
29+
username: ${{ secrets.VPS_USER }}
30+
key: ${{ secrets.VPS_SSH_KEY }}
31+
source: 'target/release/admin-api-rust'
32+
target: '/home/deploy/admin-api-rust'
33+
34+
- name: Restart service
35+
uses: appleboy/ssh-action@v0.1.4
36+
with:
37+
host: ${{ secrets.VPS_HOST }}
38+
username: ${{ secrets.VPS_USER }}
39+
key: ${{ secrets.VPS_SSH_KEY }}
40+
script: 'sudo systemctl restart admin-api-rust'

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/target

0 commit comments

Comments
 (0)