ci: deploy using pm2
* ci: pm2 configuration file * ci: github action deploy preview * ci: github action deploy production * ci: env variables now pass to pm2
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
module.exports = {
|
||||
apps: [
|
||||
{
|
||||
name: process.env.APP_NAME,
|
||||
script: 'npm',
|
||||
args: 'start',
|
||||
env: {
|
||||
NODE_ENV: 'production',
|
||||
PORT: process.env.PORT || 3000
|
||||
}
|
||||
}
|
||||
],
|
||||
|
||||
deploy: {
|
||||
production: {
|
||||
user: process.env.SSH_USERNAME,
|
||||
host: process.env.DEPLOY_HOST,
|
||||
ref: 'origin/main',
|
||||
repo: 'https://github.com/SrJuggernaut/entgamers_pro',
|
||||
path: process.env.DEPLOY_PATH,
|
||||
'pre-deploy': 'npm install && npm run build',
|
||||
'post-deploy': 'pm2 startOrRestart ecosystem.config.js',
|
||||
env: {
|
||||
...process.env
|
||||
}
|
||||
|
||||
},
|
||||
preview: {
|
||||
user: process.env.SSH_USERNAME,
|
||||
host: process.env.DEPLOY_HOST,
|
||||
ref: 'origin/preview',
|
||||
repo: 'https://github.com/SrJuggernaut/entgamers_pro',
|
||||
path: process.env.DEPLOY_PATH,
|
||||
'pre-deploy': 'npm install && npm run build',
|
||||
'post-deploy': 'pm2 startOrRestart ecosystem.config.js',
|
||||
env: {
|
||||
...process.env
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user