Deploy your code to Heroku. This step requires that you deploy to a Heroku deploy target.
To push to Heroku we need to have an ssh key. We can dynamically generate a key, add the key to your repository and then remove it, during each build. But this results in an e-mail from Heroku on each deploy.
To prevent this you can generate a private/public key pair on wercker and manually add the public key to Heroku.
- Generate a new key in wercker in the
Key management
section (application
-settings
). - Copy the public key and add it on Heroku to the
SSH Keys section
section (account
). - In wercker edit the Heroku deploy target to which you would like to deploy, and add an environment variable:
- Give the environment variable a name (remember this name, you will need it in the last step).
- Select
SSH Key pair
as the type and select the key pair which you created earlier.
- In the
heroku-deploy
step in yourwercker.yml
add thekey-name
property with the value you used earlier:
deploy:
steps:
- heroku-deploy:
key-name: MY_DEPLOY_KEY
In the above example the MY_DEPLOY_KEY
should match the environment variable name you used in wercker. Note: you should not prefix it with a dollar sign or post fix it with _PRIVATE
or _PUBLIC
.
- Make sure git-core is installed when heroku toolbelt.
key-name
(optional) Specify the name of the key that should be used for this deployment. If left empty, a temporary key will be created for the deployment.retry
(optional) When a deploy to Heroku fails, a new deploy is automatically performed after 5 seconds. If you want to disable this behavior, setretry
tofalse
.run
(optional) Run a command on heroku after the code is deployed succesfully. This option can be used to migrate the database for example.
deploy:
steps:
- heroku-deploy:
key-name: MY_DEPLOY_KEY
The MIT License (MIT)
- Make sure git-core is installed when heroku toolbelt.
- Fix bugs related to the
run
parameter.
- Update README, to clearify using a SSH Key pair.
- Fixed release that also works on ruby based boxes (always installs ruby 1.9.1)
- fix for apt-get bug: deb files are now included [broken]
- Bug fixes
- Adds
run
option.
- Retry on failure.
- Only call
heroku keys:remove
if a ephemeral key was used (wercker/step-heroku-deploy#2). - Update README.
- Fix wrong option check.
- Added validation to
key-name
option.
- Added
key-name
option.
- Initial release.