0

I have a rails app hosted on Heroku. I added a "Audio" folder in Assets. The "Audio" folder is not included into my git pushes. My app generates some audio files that are automatically added to the assets/audio folder. That's why I don't want Heroku to clean the assets inside this particular folder each time I push a modification.

One solution would be to host the generated audio files with AWS S3 but it's quite a lot of work to set up.

I wonder if, instead, there is a way to tell Heroku not to clean the assets in the "Audio" folder?

I searched on the internet but didn't find anything so far...

nico_lrx
  • 715
  • 1
  • 19
  • 36
  • Heroku deletes files by design, you cannot skip that, you have to add the files to your git repo or host them elsewhere. – arieljuod Aug 25 '18 at 18:10

1 Answers1

0

So far I know Heroku will clean you temporary assets everytime you deploy your application and the build starts.

Check this answer: Store file in directory tmp on heroku Rails

If your application is Rails 5.2 based you can implement your upload to AWS via Active Storage, check: https://evilmartians.com/chronicles/rails-5-2-active-storage-and-beyond

hernanvicente
  • 914
  • 8
  • 18
  • Thanks. What do you mean by "temporary assets"? What I do is creating a file in app/assets/audios using "file.write", just like if I add it manually in local and push it. – nico_lrx Aug 25 '18 at 17:08