Skip to content

Commit

Permalink
Finished server (#1)
Browse files Browse the repository at this point in the history
* finished server

* Fixed build error
  • Loading branch information
vishalkrishnads authored Jul 28, 2024
1 parent 6851d95 commit 7eabcb2
Show file tree
Hide file tree
Showing 24 changed files with 6,084 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ jobs:
runs-on: ubuntu-22.04

steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: setup rust
uses: actions-rs/toolchain@v1
with:
Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Deploy to VPS

on:
push:
branches: [ "main" ]

env:
CARGO_TERM_COLOR: always

jobs:
build:

runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v3
- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
toolchain: 1.75.0
override: true
- name: build project
run: cargo build --release
- name: install tools
run: sudo apt-get install sshpass rsync
- name: write changes to server
run: |
sshpass -p ${{ secrets.VPS_PASSWORD }} rsync -avz -e 'ssh -o StrictHostKeyChecking=no' target/release/ vishalds@${{ secrets.VPS_HOST }}:/home/vishalds/server/; sshpass -p ${{ secrets.VPS_PASSWORD }} rsync -avz -e 'ssh -o StrictHostKeyChecking=no' scripts/ vishalds@${{ secrets.VPS_HOST }}:/home/vishalds/scripts/
env:
VPS_PASSWORD: ${{ secrets.VPS_PASSWORD }}
- name: restart server
run: |
sshpass -p ${{ secrets.VPS_PASSWORD }} ssh -o StrictHostKeyChecking=no vishalds@${{ secrets.VPS_HOST }} 'sudo systemctl restart zitefy.service'
env:
VPS_PASSWORD: ${{ secrets.VPS_PASSWORD }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/target
/templates
.env
Loading

0 comments on commit 7eabcb2

Please sign in to comment.