Is it best-practice to run filament:upgrade on every deploy?
We have pretty extensive Filament admin panels, and we've been encountering some users having squished forms and various naughtiness.
Running
filament:upgrade
via SSH seems to fix layout for some users (maybe all?).
The built assets are in version control, and we deploy to DigitalOcean, via Ploi.
Running filament:upgrade
on every deploy feels... dangerous. But I don't want to manually run it after each upgrade...
So, is running filament:upgrade
generally considered a good-idea to put into our deploy script?
Thanks! 🙂Solution:Jump to solution
Yea. Especially if part of your deploy runs composer update, then definitely add it to the composer scripts. The filament:install command should have done it automatically though. That’s why I asked.
7 Replies
FYI: these are the types of issues we're trying to avoid.

Do you not have it in your composer post auto load dump script? You should only need to run it if you’re updating filament itself.
@awcodes It might be almost as simple as that. We have some funky scripts.
I think this is exactly the nudge we need.
Thanks 😎
J
Solution
Yea. Especially if part of your deploy runs composer update, then definitely add it to the composer scripts. The filament:install command should have done it automatically though. That’s why I asked.
@awcodes We don't commit assets on main, only on the staging branch. So
filament:upgrade
wasn't getting run. That was our mistake.
On our production server, we basically only run
So, follow-up question: Does filament:upgrade
need to be run on the production server? Or can run it on, say, our staging server and commit any changes, which would later make their way to production?The main thing is the underlying assets that filament publishes to public. Filament:upgrade internally also calls filament:assets which is the command that actually republishes the assets to public. So, it really could be done in a few ways, basically, anytime filament is updated via composer you should run filament:upgrade, but there could be use cases where filament:assets might be more appropriate.
As for the production server it would depend on if the public assets are in version control or not. But I don’t think it would hurt to run it on the production server as a deploy step or just let composer handle it.
FYI, plugins also tap into filament:assets so probably best to just run it one way or the other.
Awesome - thanks @awcodes .
You made our day!