If you want to customize the deploy script but retain the defaults, here is the default Hatchbox deploy script for Rails apps.
bundle install -j $(nproc) yarn install bundle exec rails assets:precompile [[ -n "${CRON}" ]] && bundle exec rails db:migrate