What is the easiest way to deploy static assets (JavaScript, Images, CSS, …) to Amazon S3? Is there any perfect solution?
With "perfect" I mean: git push heroku master
is the only thing I would have to do to get both my code pushed to Heroku and my assets uploaded to S3.
I don't think you're going to be able to do it 'perfectly' just using git.
What may be more use is to use something like the Heroku San plugin and use the after_deploy task to move your assets to their final resting places perhaps?
Although, aren't static assets best suited on Heroku so you can take advantage of the caching it makes use of? We typically commit all js, css and images for layout to git and deploy to Heroku whilst user assets are uploaded to S3.
I think you're going to be better off scripting this locally. One option, create a rake task that takes care of this for you (so you have access to all your gems and dependencies which should make this a simple matter of programming) and run it locally just before you push to heroku. Should be easy enough to automate.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With