From c7b8bc735781aeeddc72784d721d82568e2e51e9 Mon Sep 17 00:00:00 2001 From: JuruSysadmin Date: Wed, 7 Jan 2026 15:08:10 -0300 Subject: [PATCH] feat: Add CI/CD workflow for SSH deployment and update PM2 configuration to use `npm start` with a specified working directory. --- .gitea/workflows/deploy.yaml | 4 ++-- ecosystem.config.js | 21 ++++++++++----------- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml index 18cdf2b..40997d5 100644 --- a/.gitea/workflows/deploy.yaml +++ b/.gitea/workflows/deploy.yaml @@ -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 \ No newline at end of file diff --git a/ecosystem.config.js b/ecosystem.config.js index 8dd11ff..17e2ce1 100644 --- a/ecosystem.config.js +++ b/ecosystem.config.js @@ -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, } - ] -}; \ No newline at end of file + }] +} \ No newline at end of file