Deploy compiled typescript/node folder to heroku?

My node project is written in Typescript. Circle CI builds by typescript code and pushes the JS files into a lib folder. I would like this lib folder deployed to heroku. Currently this folder is not getting deployed to heroku, only the original source files/folders. Travis-Ci has a property called skip_cleanup that keeps the compiled folder around and pushes it to heroku. What can I do in Circle for this to work???

The expected workflow for our Heroku integration is as follows:

  • push a commit
  • CircleCI runs your tests
  • if they pass push the passing commit to Heroku
  • Heroku compiles your app using a buildpack. Here’s a buildpack for TypeScript: that could be useful in this case.

Here’s a guide for compiling TypeScript on Heroku.

It is possible to get CircleCI to deploy compiled code to Heroku, but it’s not supported by our built-in integration since this isn’t the usual workflow. This section of the docs explains how you can manually run commands in the deployment section: You can run any valid shell commands in the commands section (or even call a script) so what you can do there is very flexible.

1 Like