Using Heroku for generating (not hosting) static pages

Hi all–apologies if this has been addressed before, but wasn’t able to find an answer through a forum/stackoverflow search.

Is it possible to run a middleman app on a PaaS like Heroku? Not hosting the static pages, but actually generating static pages and then pushing from Heroku to a static host (S3, Netlify, etc.)? I need to pull in a large dataset each night, and want to use that dataset to rebuild a large number of static pages. Given that I’d need to rebuild the site nightly, I’d prefer to not run this on a local machine.

Thanks!