fix: ensure backend appsettings are included in published output and sync ecosystem files for PM2

This commit is contained in:
2025-10-29 21:44:29 -03:00
parent 0d29ba4da0
commit fdbb54a6b3

View File

@@ -71,6 +71,13 @@ jobs:
echo "Building and publishing backend..." echo "Building and publishing backend..."
dotnet publish backend/JoaoLoureiro.Portfolio.Api/JoaoLoureiro.Portfolio.Api.csproj --configuration Release --output ./publish 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..." echo "Installing frontend dependencies..."
cd frontend && npm install 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/.next/ /var/www/website.joaoloureiro.dev.br/frontend/
rsync -a --delete ./frontend/public/ /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/ 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 ./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 - name: Restart Applications with PM2
run: | run: |