Integrated rsync/ssh files again...

This commit is contained in:
Kim 2023-10-23 16:04:30 +02:00
parent e3726f92ee
commit bebb492d93
4 changed files with 48 additions and 18 deletions

View File

@ -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'

View File

@ -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'

View File

@ -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 <<END
Host production
HostName $SSH_HOST
User $SSH_USER
IdentityFile ~/.ssh/production.key
StrictHostKeyChecking no
END
env:
SSH_USER: ubuntu
SSH_KEY: ${{ secrets.PRODUCTION_SSH_KEY }}
SSH_HOST: ${{ secrets.PRODUCTION_SSH_HOST }}
- run |
ssh production 'sudo systemctl restart backend'
ssh production 'sudo cp -rf ~/frontend/build/* /var/www/html/monitor.innov.energy/html/'
ssh production 'sudo npm install -g serve'
- run: echo " This job's status is ${{ job.status }}."

View File

@ -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 Stage
run: |
- uses: burnett01/rsync-deployments@6.0.0
- run: |
cd ${{ gitea.workspace }}
./.gitea/Stage-deploy.sh
rsync -av ./csharp/App/Backend/bin/Release/net6.0/linux-x64/publish/ ubuntu@${{ secrets.STAGING_SSH_HOST }}:~/backend
rsync -av ./typescript/frontend-marios2/* ubuntu@${{ secrets.STAGING_SSH_HOST }}:~/frontend/
- name: Configure SSH
run: |
mkdir -p ~/.ssh/
echo "$SSH_KEY" > ~/.ssh/staging.key
chmod 600 ~/.ssh/staging.key
cat >>~/.ssh/config <<END
Host staging
HostName $SSH_HOST
User $SSH_USER
IdentityFile ~/.ssh/staging.key
StrictHostKeyChecking no
END
env:
SSH_USER: ubuntu
SSH_KEY: ${{ secrets.STAGING_SSH_KEY }}
SSH_HOST: ${{ secrets.STAGING_SSH_HOST }}
- run |
ssh staging 'sudo systemctl restart backend'
ssh staging 'sudo cp -rf ~/frontend/build/* /var/www/html/monitor.innov.energy/html/'
ssh staging 'sudo npm install -g serve'
- run: echo " This job's status is ${{ job.status }}."