Deploy to H100 #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy to H100 | |
on: | |
push: | |
branches: [ main ] | |
paths: | |
- 'src/backend/**' | |
workflow_dispatch: | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install sshpass | |
run: sudo apt-get install -y sshpass | |
- name: Deploy with rsync | |
env: | |
SSH_PASS: ${{ secrets.SSH_PASSWORD }} | |
run: | | |
sshpass -p "$SSH_PASS" rsync -avz --delete \ | |
-e "ssh -o StrictHostKeyChecking=no" \ | |
--exclude '.env' \ | |
--exclude 'venv/' \ | |
--exclude '__pycache__/' \ | |
--exclude '*.pyc' \ | |
./src/backend/ [email protected]:/home/ubuntu/backend/ | |
- name: Install dependencies and restart service | |
env: | |
SSH_PASS: ${{ secrets.SSH_PASSWORD }} | |
run: | | |
sshpass -p "$SSH_PASS" ssh -o StrictHostKeyChecking=no [email protected] ' | |
cd /home/ubuntu/backend && \ | |
python3 -m venv venv || true && \ | |
source venv/bin/activate && \ | |
pip install -r requirements.txt | |
' |