From 5cab8142b23b6affa8e873c8e76db97118e97a96 Mon Sep 17 00:00:00 2001 From: Michael Clapham Date: Sat, 7 Sep 2024 22:46:42 +0100 Subject: [PATCH] Stop service before uploading, and overwrite with new binary --- .github/workflows/deploy.yml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 2f6412d..85b79f8 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -36,7 +36,17 @@ jobs: - run: ls -l - - name: copy file via ssh password + - name: Stop service + uses: appleboy/ssh-action@v1.0.3 + with: + host: ${{ secrets.SSH_HOST }} + username: ${{ secrets.SSH_USERNAME }} + password: ${{ secrets.SSH_PASSWORD }} + port: ${{ secrets.SSH_PORT }} + script: sudo /usr/bin/systemctl stop qrsync_server + + + - name: Upload new binary uses: appleboy/scp-action@v0.1.7 with: host: ${{ secrets.SSH_HOST }} @@ -45,8 +55,9 @@ jobs: port: ${{ secrets.SSH_PORT }} source: "qrsync-server" target: /var/www/qrsync_server + overwrite: true - - name: executing remote ssh commands using password + - name: Restart service uses: appleboy/ssh-action@v1.0.3 with: host: ${{ secrets.SSH_HOST }}