From 441bbaae9c1905bce3d6a604cc7250535e3fb2d3 Mon Sep 17 00:00:00 2001 From: Kim Date: Mon, 6 Nov 2023 14:01:40 +0100 Subject: [PATCH] took out some sudo commands --- .gitea/workflows/stage-deploy.yaml | 9 +++------ csharp/App/Backend/Resources/deploy.sh | 4 ++++ 2 files changed, 7 insertions(+), 6 deletions(-) create mode 100644 csharp/App/Backend/Resources/deploy.sh diff --git a/.gitea/workflows/stage-deploy.yaml b/.gitea/workflows/stage-deploy.yaml index 51a3bdebd..6c533711b 100644 --- a/.gitea/workflows/stage-deploy.yaml +++ b/.gitea/workflows/stage-deploy.yaml @@ -28,7 +28,7 @@ jobs: username: ubuntu key: ${{ secrets.STAGING_SSH_KEY }} source: "${{ gitea.workspace }}/csharp/App/Backend/bin/Release/net6.0/linux-x64/publish/" - target: "staging:~/backend" + target: "~/backend" - name: Copy Frontend uses: appleboy/scp-action@v0.1.4 @@ -37,19 +37,16 @@ jobs: username: ubuntu key: ${{ secrets.STAGING_SSH_KEY }} source: "${{ gitea.workspace }}/typescript/frontend-marios2/" - target: "staging:~/frontend" + target: "~/frontend" - name: restart services uses: appleboy/ssh-action@v0.1.4 with: host: 91.92.154.141 username: ubuntu -# key_path: /root/.ssh/id_rsa key: ${{ secrets.STAGING_SSH_KEY }} script: | - sudo systemctl restart backend - sudo cp -rf ~/frontend/build/* /var/www/html/monitor.innov.energy/html/ - sudo npm install -g serve + sudo ~/backend/Resources/deploy.sh - run: echo " This job's status is ${{ job.status }}." diff --git a/csharp/App/Backend/Resources/deploy.sh b/csharp/App/Backend/Resources/deploy.sh new file mode 100644 index 000000000..0a142a00c --- /dev/null +++ b/csharp/App/Backend/Resources/deploy.sh @@ -0,0 +1,4 @@ +#!/bin/bash +sudo systemctl restart backend +sudo cp -rf ~/frontend/build/* +sudo npm install -g serve/var/www/html/monitor.innov.energy/html/ \ No newline at end of file