Innovenergy_trunk/.gitea/workflows/prod-deploy.yaml

31 lines
1.4 KiB
YAML
Raw Normal View History

2023-10-23 12:16:27 +00:00
name: Production-Deploy
on:
push:
tags:
- v1.**
jobs:
Build-and-deploy-Production:
runs-on: ubuntu-latest
steps:
- run: echo " The job was automatically triggered by a ${{ gitea.event_name }} event."
- run: echo " The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}."
- name: Check out repository code
2023-10-23 12:27:23 +00:00
uses: actions/checkout@v3
2023-10-23 12:16:27 +00:00
- run: echo " The ${{ gitea.repository }} repository has been cloned to the runner."
- name: Build backend
2023-10-23 12:27:23 +00:00
uses: actions/setup-dotnet@v3
2023-10-23 12:28:13 +00:00
- run: |
2023-10-23 12:16:27 +00:00
dotnet publish ${{ gitea.workspace }}/csharp/App/Backend/Backend.csproj -c Release -r linux-x64 --self-contained true -p:PublishTrimmed=false
- name: Build frontend
2023-10-23 12:27:23 +00:00
uses: actions/setup-node@v3
2023-10-23 12:28:13 +00:00
- run: |
2023-10-23 12:16:27 +00:00
npm run build
- name: copy everything to Production
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'
- run: echo " This job's status is ${{ job.status }}."