-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (36 loc) · 1017 Bytes
/
deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
name: Update Bot
on:
push:
branches: [ main ]
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: Restart Bot via SSH
uses: appleboy/[email protected]
with:
host: ${{ secrets.SERVER_IP }}
username: root
key: ${{ secrets.SSH_PRIVATE_KEY }}
script: |
echo "Starting or restarting the Antbot service"
sudo systemctl restart antbot-watcher.service
echo "Workflow completed"
script_stop: true
timeout: 60s