PM2: Ghost workflow
by Alexandre Strzelewicz -

Make Ghost more easy to deploy
Work on local, deploy on production
For only 5$ per month you will get fast server. Digitalocean with Ubuntu droplet.

$ curl -L https://ghost.org/zip/ghost-latest.zip -o ghost.zip
$ unzip -uo ghost.zip -d ghost
$ cd /path/to/ghost
$ npm install --production

$ npm install pm2 -g
$ pm2 ecosystem
$ edit file

$ create a remote git filesystem and
$ git init
$ git add .
$ git commit -am "first ghost"
$ git push origin master

$ edit config.js file

$ on remote
$ ln -s files to dont loose file and DB
$ install node
$ npm install pm2 -g
{
  "apps" : [{
    "name"      : "ghost-blog",
    "script"    : "app.js",
    "args" : "[--production]",
    "env": {
      "NODE_ENV": "production"
    }
  }],
  "deploy" : {
    "production" : {
      "user" : "node",
      "host" : "212.83.163.1",
      "repo" : "git@github.com:repo.git",
      "path" : "/var/www/production"
    }
  }
}
$ pm2 deploy production setup
$ pm2 deploy production