From 6a7923b8d282907a374388ee2c1f41df83d75215 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Schr=C3=B6dinger?= <132720404+Schrodinger71@users.noreply.github.com> Date: Fri, 20 Sep 2024 08:34:58 +0000 Subject: [PATCH] Update deploy.yml --- .github/workflows/deploy.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index d5cd9a5..b0a313b 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -2,11 +2,8 @@ name: Deploy Discord Bot on: schedule: - # Запускать каждые 7 часов - - cron: '0 */7 * * *' -# push: -# branches: -# - main + # Запускать каждые 5 часов + - cron: '0 */5 * * *' jobs: deploy: @@ -31,8 +28,12 @@ jobs: echo "DISCORD_KEY=${{ secrets.DISCORD_KEY }}" >> $GITHUB_ENV echo "GITHUB=${{ secrets.GITHUB }}" >> $GITHUB_ENV + - name: Kill previous bot instance (if running) + run: | + pkill -f main.py || true + - name: Run bot env: DISCORD_TOKEN: ${{ secrets.DISCORD_TOKEN }} run: | - python main.py + python main.py & \ No newline at end of file