Fixed some errors when API is unavaliable #14
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 | |
on: | |
push: | |
branches: [ master ] | |
jobs: | |
deploy: | |
name: Deploy | |
runs-on: ubuntu-latest | |
env: | |
HOST: angron42.pp.ua | |
USERNAME: root | |
KEY: ${{ secrets.SSH_PRIVATE_KEY }} | |
PORT: 22 | |
steps: | |
- name: Stop server | |
uses: appleboy/ssh-action@master | |
with: | |
host: HOST | |
username: USERNAME | |
key: KEY | |
port: PORT | |
script: | | |
screen -wipe | |
if screen -list | grep -q "dteubot"; then | |
screen -X -S dteubot quit; | |
fi | |
- name: Pull changes | |
uses: appleboy/ssh-action@master | |
with: | |
host: HOST | |
username: USERNAME | |
key: KEY | |
port: PORT | |
script: | | |
cd ~/dteubot | |
git pull -f origin master | |
- name: Setup | |
uses: appleboy/ssh-action@master | |
with: | |
host: HOST | |
username: USERNAME | |
key: KEY | |
port: PORT | |
script: | | |
cd ~/dteubot | |
pip install -r requirements.txt | |
cd ~/bot-data | |
echo '${{ secrets.ENV }}' > .env | |
python ~/dteubot/scripts/update_chat_configs.py chat-configs | |
- name: Run | |
uses: appleboy/ssh-action@master | |
with: | |
host: HOST | |
username: USERNAME | |
key: KEY | |
port: PORT | |
script: bash ~/bot-data/run.sh |