Skip to content

change server workdir #3

change server workdir

change server workdir #3

Workflow file for this run

name: SCID 3 Bot Workflow
on:
push:
branches:
- master
- dev # закомментить перед выходом в прод
pull_request:
branches:
- dev
jobs:
linter:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8
- name: Test with flake8
run: python -m flake8 app/
deploy:
runs-on: ubuntu-latest
needs: linter
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Copy docker-compose.yml via ssh
uses: appleboy/scp-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USER }}
key: ${{ secrets.SSH_KEY }}
passphrase: ${{ secrets.SSH_PASSPHRASE }}
source: "docker-compose.yml"
target: "scid_bot"
- name: Executing remote ssh commands to deploy
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USER }}
key: ${{ secrets.SSH_KEY }}
passphrase: ${{ secrets.SSH_PASSPHRASE }}
script: |
cd scid_bot
sudo docker compose -f docker-compose.yml pull
sudo docker compose -f docker-compose.yml down
sudo docker compose -f docker-compose.yml up -d
send_message:
runs-on: ubuntu-latest
needs: deploy
steps:
- name: Send message
uses: appleboy/telegram-action@master
with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
message: Деплой успешно выполнен!