rsync and ssh into their own files

This commit is contained in:
Kim 2023-10-23 15:32:53 +02:00
parent c0112a12e8
commit 37603e501e
4 changed files with 25 additions and 19 deletions

7
.gitea/Prod-deploy.sh Normal file
View File

@ -0,0 +1,7 @@
#/bin/bash
rsync -av ${{ gitea.workspace }}/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 ${{ gitea.workspace }}/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'

7
.gitea/Stage-deploy.sh Normal file
View File

@ -0,0 +1,7 @@
#/bin/bash
rsync -av ${{ gitea.workspace }}/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 ${{ gitea.workspace }}/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'

View File

@ -13,19 +13,15 @@ jobs:
- name: Check out repository code
uses: actions/checkout@v3
- run: echo " The ${{ gitea.repository }} repository has been cloned to the runner."
- name: Build backend
uses: actions/setup-dotnet@v3
- uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0.x'
- run: dotnet publish ${{ gitea.workspace }}/csharp/App/Backend/Backend.csproj -c Release -r linux-x64 --self-contained true -p:PublishTrimmed=false
- uses: actions/setup-node@v3
- run: |
dotnet publish ${{ gitea.workspace }}/csharp/App/Backend/Backend.csproj -c Release -r linux-x64 --self-contained true -p:PublishTrimmed=false
- name: Build frontend
uses: actions/setup-node@v3
- run: |
npm run build
- name: copy everything to Production
npm --prefix ${{ gitea.workspace }}/typescript/frontend-marios2 install
npm --prefix ${{ gitea.workspace }}/typescript/frontend-marios2 run build
- name: copy everything to Prod
run: |
rsync -av ${{ gitea.workspace }}/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 -rv .* 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'
${{ gitea.workspace }}/.gitea/Prod-deploy.sh
- run: echo " This job's status is ${{ job.status }}."

View File

@ -21,11 +21,7 @@ jobs:
- run: |
npm --prefix ${{ gitea.workspace }}/typescript/frontend-marios2 install
npm --prefix ${{ gitea.workspace }}/typescript/frontend-marios2 run build
- name: copy everything to Stage
- name: copy everything to Stage
run: |
rsync -av ${{ gitea.workspace }}/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 -rv ${{ gitea.workspace }}/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'
${{ gitea.workspace }}/.gitea/Stage-deploy.sh
- run: echo " This job's status is ${{ job.status }}."