各種設定が済んでいる事が前提で、本番環境でgit pullする際の流れです。
cloud9上でプッシュまでします。
$ git add .
$ git commit -m "コメント"
$ git push origin ブランチ名
それからEC2にログイン
$ ssh -i ~/.ssh/practice-aws.pem ec2-user@xx.xx.xx.xx
practice-aws.pemはキーペア名、
xx.xx.xx.xxはパブリックIPアドレスを入力
EC2上でアプリケーションに移動してpull
$ cd アプリケーション名
$ git pull origin master
Gemfile更新
$ bundle install --path vendor/bundle --without test development
migrate更新
$ bundle exec rails db:migrate RAILS_ENV=production
assets更新
$ bundle exec rails assets:precompile RAILS_ENV=production
サーバー再起動
$ kill $(cat tmp/pids/puma.pid)
$ rails s -e production