The integrated Heroku deployment on Codeship is based on running a git push, so you would need to run the npm run build --release
command, and then commit those changes to the repository.
That would also require you to enable force pushing to the remote repository on Heroku as the next build (triggered by GitHub/Bitbucket/Gitlab) would not include that auto-generated commit.
That said, we built a script to deploy to Heroku based on their build API, which is available at https://github.com/codeship-library/heroku-deployment/blob/master/scripts/codeship_heroku_deploy
It is intended to be used by our Docker based platform (called Codeship Pro), but the same commands would work as a custom script deployment on Codeship Basic as well.