feat: Add CI/CD workflow for SSH deployment and update PM2 configuration to use `npm start` with a specified working directory.
Deploy Next.js via SSH / deploy (push) Successful in 27s Details

This commit is contained in:
JuruSysadmin 2026-01-07 15:08:10 -03:00
parent 56efe77603
commit c7b8bc7357
2 changed files with 12 additions and 13 deletions

View File

@ -14,8 +14,8 @@ jobs:
username: juru
key: ${{ secrets.SSH_PRIVATE_KEY }}
script: |
cd /home/juru/portal-dias-rota
cd /home/juru/Portal-dias-rota
git pull origin main
npm install
npm install --legacy-peer-deps
npm run build
pm2 restart portal-dias-rota || pm2 start npm --name "portal-dias-rota" -- start

View File

@ -1,13 +1,12 @@
module.exports = {
apps: [
{
name: "portal-dias-rota",
script: ".next/standalone/server.js",
args: "start",
env: {
NODE_ENV: "production",
PORT: 3003
}
apps: [{
name: "portal-dias-rota",
script: "npm",
args: "start",
cwd: "/home/juru/Portal-dias-rota",
env: {
NODE_ENV: "production",
PORT: 3003,
}
]
};
}]
}