diff --git a/.gitea/Prod-deploy.sh b/.gitea/Prod-deploy.sh deleted file mode 100755 index 91162e0a4..000000000 --- a/.gitea/Prod-deploy.sh +++ /dev/null @@ -1,6 +0,0 @@ -#/bin/bash -rsync -av ./csharp/App/Backend/bin/Release/net6.0/linux-x64/publish/ ubuntu@194.182.190.208:~/backend -ssh ubuntu@194.182.190.208 'sudo systemctl restart backend' -rsync -av ./typescript/frontend-marios2/* ubuntu@194.182.190.208:~/frontend/ -ssh ubuntu@194.182.190.208 'sudo cp -rf ~/frontend/build/* /var/www/html/monitor.innov.energy/html/' -ssh ubuntu@194.182.190.208 'sudo npm install -g serve' \ No newline at end of file diff --git a/.gitea/Stage-deploy.sh b/.gitea/Stage-deploy.sh deleted file mode 100755 index 9d445de3a..000000000 --- a/.gitea/Stage-deploy.sh +++ /dev/null @@ -1,6 +0,0 @@ -#/bin/bash -rsync -av ./csharp/App/Backend/bin/Release/net6.0/linux-x64/publish/ ubuntu@91.92.154.141:~/backend -ssh ubuntu@91.92.154.141 'sudo systemctl restart backend' -rsync -av ./typescript/frontend-marios2/* ubuntu@91.92.154.141:~/frontend/ -ssh ubuntu@91.92.154.141 'sudo cp -rf ~/frontend/build/* /var/www/html/monitor.innov.energy/html/' -ssh ubuntu@91.92.154.141 'sudo npm install -g serve' \ No newline at end of file diff --git a/.gitea/workflows/prod-deploy.yaml b/.gitea/workflows/prod-deploy.yaml index f43551be7..01ed78755 100644 --- a/.gitea/workflows/prod-deploy.yaml +++ b/.gitea/workflows/prod-deploy.yaml @@ -21,8 +21,29 @@ jobs: - run: | npm --prefix ${{ gitea.workspace }}/typescript/frontend-marios2 install npm --prefix ${{ gitea.workspace }}/typescript/frontend-marios2 run build - - name: copy everything to Prod - run: | + - uses: burnett01/rsync-deployments@6.0.0 + - run: | cd ${{ gitea.workspace }} - ./.gitea/Prod-deploy.sh + rsync -av ./csharp/App/Backend/bin/Release/net6.0/linux-x64/publish/ ubuntu@${{ secrets.PRODUCTION_SSH_HOST }}:~/backend + rsync -av ./typescript/frontend-marios2/* ubuntu@${{ secrets.PRODUCTION_SSH_HOST }}:~/frontend/ + - name: Configure SSH + run: | + mkdir -p ~/.ssh/ + echo "$SSH_KEY" > ~/.ssh/production.key + chmod 600 ~/.ssh/production.key + cat >>~/.ssh/config < ~/.ssh/staging.key + chmod 600 ~/.ssh/staging.key + cat >>~/.ssh/config <