feat: Add Gitea workflow for SSH blue-green deployment and update PM2 config for Next.js standalone output.
Deploy Next.js via SSH / deploy (push) Successful in 8s
Details
Deploy Next.js via SSH / deploy (push) Successful in 8s
Details
This commit is contained in:
parent
c8bffb7f05
commit
36226cbd4a
|
|
@ -14,7 +14,7 @@ jobs:
|
||||||
username: juru
|
username: juru
|
||||||
key: ${{ secrets.SSH_PRIVATE_KEY }}
|
key: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||||
script: |
|
script: |
|
||||||
RELEASE_NAME=commit-${GITHUB_SHA::7}
|
RELEASE_NAME=release-$(date +%Y%m%d%H%M%S)
|
||||||
RELEASE_PATH=/home/juru/apps/releases/$RELEASE_NAME
|
RELEASE_PATH=/home/juru/apps/releases/$RELEASE_NAME
|
||||||
|
|
||||||
git clone http://10.1.1.124:3000/joelson/Portal-dias-rota.git $RELEASE_PATH
|
git clone http://10.1.1.124:3000/joelson/Portal-dias-rota.git $RELEASE_PATH
|
||||||
|
|
@ -24,6 +24,9 @@ jobs:
|
||||||
npm install
|
npm install
|
||||||
npm run build
|
npm run build
|
||||||
|
|
||||||
|
cp -r public .next/standalone/
|
||||||
|
cp -r .next/static .next/standalone/.next/
|
||||||
|
|
||||||
ln -sfn $RELEASE_PATH /home/juru/apps/current
|
ln -sfn $RELEASE_PATH /home/juru/apps/current
|
||||||
|
|
||||||
pm2 reload portal-dias-rota || pm2 start /home/juru/apps/current/ecosystem.config.js
|
pm2 reload portal-dias-rota || pm2 start /home/juru/apps/current/ecosystem.config.js
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,12 @@
|
||||||
module.exports = {
|
module.exports = {
|
||||||
apps: [{
|
apps: [{
|
||||||
name: "portal-dias-rota",
|
name: "portal-dias-rota",
|
||||||
script: "npm",
|
script: "server.js",
|
||||||
args: "start",
|
cwd: "/home/juru/apps/current/.next/standalone",
|
||||||
cwd: "/home/juru/Portal-dias-rota",
|
|
||||||
env: {
|
env: {
|
||||||
NODE_ENV: "production",
|
NODE_ENV: "production",
|
||||||
PORT: 3003,
|
PORT: 3003,
|
||||||
|
HOSTNAME: "0.0.0.0"
|
||||||
}
|
}
|
||||||
}]
|
}]
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue