From eaf2d8f9283b2c9cf66120e7c3226847427e367b Mon Sep 17 00:00:00 2001 From: Elena Shovtyuk <110084590+elenashovtyuk@users.noreply.github.com> Date: Sat, 2 Sep 2023 22:06:59 +0300 Subject: [PATCH] fix workflow --- .github/workflows/deploy-bot-on-prod.yml | 11 +++++------ .github/workflows/deploy-bot-on-stage.yml | 11 +++++------ 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/.github/workflows/deploy-bot-on-prod.yml b/.github/workflows/deploy-bot-on-prod.yml index e43e70f..547e448 100644 --- a/.github/workflows/deploy-bot-on-prod.yml +++ b/.github/workflows/deploy-bot-on-prod.yml @@ -19,7 +19,7 @@ jobs: host: ${{ secrets.VM_HOST }} username: ${{ secrets.VM_USER }} password: ${{ secrets.VM_PASSWORD }} - source: "infra/prod/spread_wings_bot.service" + source: "infra/prod/" target: /home/deploy/spread_wings_bot/infra/prod/ - name: ssh pull and start uses: appleboy/ssh-action@master @@ -29,7 +29,6 @@ jobs: password: ${{ secrets.VM_PASSWORD }} script: | cd /home/deploy/spread_wings_bot/infra/prod/ - git pull rm .env touch .env @@ -71,10 +70,10 @@ jobs: # Installing defend service for app # Шаг с копированием в строках 16-23 можно заменить командой ниже - нужно тестировать - # scp infra/prod/spread_wings_bot.service . - cp -f /home/deploy/spread_wings_bot/infra/prod/spread_wings_bot.service /etc/systemd/system/spread_wings_bot.service - systemctl daemon-reload - systemctl restart spread_wings_bot.service + # scp infra/prod/spread_wings_bot.service ${{ secrets.VM_USER }}@${{ secrets.VM_HOST }}:/spread_wings_bot/infra/prod/ + sudo cp -f /home/deploy/spread_wings_bot/infra/prod/spread_wings_bot.service /etc/systemd/system/spread_wings_bot.service + sudo systemctl daemon-reload + sudo systemctl restart spread_wings_bot.service # Installing the app docker-compose -f docker-compose.stage.yaml stop diff --git a/.github/workflows/deploy-bot-on-stage.yml b/.github/workflows/deploy-bot-on-stage.yml index 92b1511..82b2f35 100644 --- a/.github/workflows/deploy-bot-on-stage.yml +++ b/.github/workflows/deploy-bot-on-stage.yml @@ -19,7 +19,7 @@ jobs: host: ${{ secrets.VM_HOST }} username: ${{ secrets.VM_USER }} password: ${{ secrets.VM_PASSWORD }} - source: "infra/dev/spread_wings_bot.service" + source: "infra/dev/" target: /home/deploy/spread_wings_bot/infra/dev/ - name: ssh pull and start uses: appleboy/ssh-action@master @@ -29,7 +29,6 @@ jobs: password: ${{ secrets.VM_PASSWORD }} script: | cd /home/deploy/spread_wings_bot/infra/dev/ - git pull rm .env touch .env @@ -71,10 +70,10 @@ jobs: # Installing defend service for app # Шаг с копированием в строках 16-23 можно заменить командой ниже - нужно тестировать - # scp infra/dev/spread_wings_bot.service . - cp -f /home/deploy/spread_wings_bot/infra/dev/spread_wings_bot.service /etc/systemd/system/spread_wings_bot.service - systemctl daemon-reload - systemctl restart spread_wings_bot.service + # scp infra/dev/spread_wings_bot.service ${{ secrets.VM_USER }}@${{ secrets.VM_HOST }}:/spread_wings_bot/infra/dev/ + sudo cp -f /home/deploy/spread_wings_bot/infra/dev/spread_wings_bot.service /etc/systemd/system/spread_wings_bot.service + sudo systemctl daemon-reload + sudo systemctl restart spread_wings_bot.service # Installing the app docker-compose -f docker-compose.stage.yaml stop