Before deploying Ktor project to Heroku we need to do 2 things.
- Firstly, we need to add new gradle task with name
stage
. Just paste code below:
tasks {
task("stage") {
dependsOn("installDist")
}
}
- Second thing is to create a file called
Procfile
which is required by Heroku (in project root directory). Should be just a text file but withouttxt.
suffix. After that, run taskstage
to be sure to install app build. Last step is to paste path to this generated build. E.g.
web: build/install/com.pro8l3m.ktor-fake-users/bin/com.pro8l3m.ktor-fake-users
- Commit and push changes to project repository on GitHub
- Push previosly commited changes to Heroku with line below:
git push heroku master