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
Deploy Next.js via SSH / deploy (push) Successful in 27s
Details
This commit is contained in:
parent
56efe77603
commit
c7b8bc7357
|
|
@ -14,8 +14,8 @@ jobs:
|
||||||
username: juru
|
username: juru
|
||||||
key: ${{ secrets.SSH_PRIVATE_KEY }}
|
key: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||||
script: |
|
script: |
|
||||||
cd /home/juru/portal-dias-rota
|
cd /home/juru/Portal-dias-rota
|
||||||
git pull origin main
|
git pull origin main
|
||||||
npm install
|
npm install --legacy-peer-deps
|
||||||
npm run build
|
npm run build
|
||||||
pm2 restart portal-dias-rota || pm2 start npm --name "portal-dias-rota" -- start
|
pm2 restart portal-dias-rota || pm2 start npm --name "portal-dias-rota" -- start
|
||||||
|
|
@ -1,13 +1,12 @@
|
||||||
module.exports = {
|
module.exports = {
|
||||||
apps: [
|
apps: [{
|
||||||
{
|
|
||||||
name: "portal-dias-rota",
|
name: "portal-dias-rota",
|
||||||
script: ".next/standalone/server.js",
|
script: "npm",
|
||||||
args: "start",
|
args: "start",
|
||||||
|
cwd: "/home/juru/Portal-dias-rota",
|
||||||
env: {
|
env: {
|
||||||
NODE_ENV: "production",
|
NODE_ENV: "production",
|
||||||
PORT: 3003
|
PORT: 3003,
|
||||||
}
|
}
|
||||||
}
|
}]
|
||||||
]
|
}
|
||||||
};
|
|
||||||
Loading…
Reference in New Issue