Heroku buildpack provides ability to copy .yml.sample config files in your rails projects.
The key have to be stored in the application's env:
heroku config:set COPY_SAMPLE_FILE_TEMPLATE="yml.sample"
Then you have to install this buildpack on your app:
heroku buildpacks:add -i 1 https://github.com/spirosure/heroku-buildpack-copy-samples.git
Or you can read Instructions
Copy the snippet above into CLI.