Skip to content

Update Bot

Update Bot #3

Workflow file for this run

name: Update Bot
on:
workflow_dispatch:
jobs:
deploy-via-sftp:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: SFTP Deploy
uses: wlixcc/[email protected]
with:
username: root
server: ${{ secrets.SERVER_IP }}
port: 22
ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }}
local_path: ./*
remote_path: /home/antbot/
args: '-o ConnectTimeout=5'
restart-bot:
needs: [deploy-via-sftp]
runs-on: ubuntu-latest
steps:
- name: Stop and Restart Bot via SSH
uses: fifsky/ssh-action@master
with:
host: ${{ secrets.SERVER_IP }}
user: root
key: ${{ secrets.SSH_PRIVATE_KEY }}
script: |
cd /home/antbot/
source .venv/bin/activate
pkill -f 'python main.py'
nohup python main.py &