From fdbb54a6b3b110c78a5e5c1c03f483a7af973ecf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Loureiro?= Date: Wed, 29 Oct 2025 21:44:29 -0300 Subject: [PATCH] fix: ensure backend appsettings are included in published output and sync ecosystem files for PM2 --- .gitea/workflows/deploy.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index ba48803..70e0881 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -71,6 +71,13 @@ jobs: echo "Building and publishing backend..." dotnet publish backend/JoaoLoureiro.Portfolio.Api/JoaoLoureiro.Portfolio.Api.csproj --configuration Release --output ./publish + echo "Copying backend appsettings to published output..." + # ensure the production appsettings travels with the published output so the deployed app reads it + if [ -f backend/appsettings.Production.json ]; then + mkdir -p ./publish + cp backend/appsettings.Production.json ./publish/ + fi + echo "Installing frontend dependencies..." cd frontend && npm install @@ -84,7 +91,9 @@ jobs: rsync -a --delete ./frontend/.next/ /var/www/website.joaoloureiro.dev.br/frontend/ rsync -a --delete ./frontend/public/ /var/www/website.joaoloureiro.dev.br/frontend/ rsync -a ./frontend/package.json /var/www/website.joaoloureiro.dev.br/frontend/ + # copy both frontend and backend ecosystem files into the deployment root so PM2 can find them rsync -a ./frontend/ecosystem.config.json /var/www/website.joaoloureiro.dev.br/frontend/ + rsync -a ./backend/ecosystem.config.json /var/www/website.joaoloureiro.dev.br/backend/ - name: Restart Applications with PM2 run: |