-
Notifications
You must be signed in to change notification settings - Fork 1
32 lines (31 loc) · 1.04 KB
/
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
name: scp files
on: [push]
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: copy file via ssh password
uses: appleboy/scp-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
port: ${{ secrets.PORT }}
source: "*"
target: "/home/${{ secrets.USERNAME }}/eastbot"
- name: executing remote ssh commands using password
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
port: ${{ secrets.PORT }}
script: |
cd /home/${{ secrets.USERNAME }}/eastbot
echo ${{ secrets.PASSWORD }} | sudo -S systemctl stop python-eastafrica-bot.service
source venv/bin/activate
pip install -r requirements.txt
deactivate
echo ${{ secrets.PASSWORD }} | sudo -S systemctl start python-eastafrica-bot.service