heroku.yml manifest now supports release phase

Change effective on 28 March 2018

Release phase enables you to run tasks before a new release is deployed to production (e.g., sending CSS/JS/assets to a CDN, priming cache stores, or running database schema migrations).

To define a release phase command, specify a release section with a command in your heroku.yml:

build:
  ...
release:
  command:
    - rake db:migrate
run:
  web: bundle exec puma -C config/puma.rb

If you’ve defined a Dockerfile build, you can also specify the Docker image to use to execute the command:

build:
  docker:
    web: Dockerfile
    worker: worker/Dockerfile
release:
  image: worker
  command:
    - ./deployment-tasks.sh

Learn more about heroku.yml.