based on DigitalOcean guide
Create local project
local$ rails new appname -T -d postgresql
local$ rails g scaffold Story title:string body:text
local$ rails db:migrate
Go to Step 1.1 "Create deploy user" (remote root$)
Go to Step 1.2 "Setup rbenv ruby rails nginx postgresql" (remote deploy$)
Setup ssh for GitHub
deploy$ ssh-keygen -t rsa # Add the newly created public key (~/.ssh/id_rsa.pub) to your repository’s deployment keys
Go to step 2 "Setup local Capistrano"
Go to step 3 "Setup local Capfile"
Go to step 4 "Setup local deploy.rb file"
Go to step 5 "Setup local nginx.conf file"
DEPLOYING RAILS APP
local$ git add -A
local$ git commit -m "Set up Puma, Nginx & Capistrano"
local$ git push origin master
sharing creds based on Medium column
Copy config/master.key
from local filesystem
to the production server under appname/shared/config/master.key
local$ cap production deploy:initial
Reboot Nginx
deploy$ sudo rm /etc/nginx/sites-enabled/default
deploy$ sudo ln -nfs "/home/deploy/apps/appname/current/config/nginx.conf" "/etc/nginx/sites-enabled/appname"
deploy$ sudo service nginx restart