Skip to content

Переход на новую версию Longpoll, избавление от лишнего аргумента. #57

Переход на новую версию Longpoll, избавление от лишнего аргумента.

Переход на новую версию Longpoll, избавление от лишнего аргумента. #57

Workflow file for this run

name: Deploy
on: [push, workflow_dispatch]
jobs:
run_pull:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.10"
cache: "pip"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt pytest
- name: Run pytest
run: |
python -m pytest -v
- name: Deploy on server
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USER }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
script: |
cd ${{ secrets.WORK_DIR }}
branch_name=$(basename ${{ github.ref }})
git checkout ${{ secrets.MAIN_BRANCH }}
git fetch --all
git reset --hard origin/$branch_name
source venv/bin/activate
pip install --upgrade --force-reinstall -r requirements.txt
systemctl --user restart ${{ secrets.SERVICE_NAME }}
exit