File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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'
Original file line number Diff line number Diff line change 1+ /target
You can’t perform that action at this time.
0 commit comments