Skip to content

Commit

Permalink
finished server
Browse files Browse the repository at this point in the history
  • Loading branch information
vishalkrishnads committed Jul 28, 2024
1 parent 6851d95 commit a320c12
Show file tree
Hide file tree
Showing 23 changed files with 6,082 additions and 0 deletions.
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 a320c12

Please sign in to comment.