Heroku Pipelines are great, CDNs are great, and Fontawesome is great.

But we’ve noticed that the trio do not play nicely in some cases.

Specifically, we have a Staging app and a Production app on Heroku and each (used to!) have its own Cloudfront CDN.

But when an app uses Fontawesome we found that heroku pipelines:push -r my_staging_remote pushes the references to the staging CDN to the production app. But only for Fontawesome for some reason. Which sometimes would cause Fontawesome symbols to display as little “missing” icons on the production app.

We tried sharing the same CDN between staging and production, but still ran into issues with reliable access to the assets on both platforms, sometimes encountering “asset expired” errors on production leading to missing stylesheets.

One solution: Skipping heroku pipelines:push and re-pushing straight to production git push our_prod_app master works fine, since it rebuilds the asset pipeline on production. However it makes the push to production slower compared to the almost instant process of pushing up the pipeline from staging to production.

Better solution: The problem went away when we configured the Staging app to not use a CDN (simply removing the CDN_ASSETS ENV variable that used to point to our staging-specific Cloudfront distribution xxxxx.cloudfront.net) to skip the asset_host initialization:

# config/environments/staging.rb
  unless ENV["CDN_ASSETS"].blank?
    config.action_controller.asset_host = ENV["CDN_ASSETS"]