#Is it best-practice to run filament:upgrade on every deploy?

11 messages · Page 1 of 1 (latest)

silk pasture
#

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! 🙂

tawny condorBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> ✅ Mark Solution

silk pasture
#

FYI: these are the types of issues we're trying to avoid.

rugged imp
#

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.

silk pasture
#

@rugged imp It might be almost as simple as that. We have some funky scripts.
I think this is exactly the nudge we need.
Thanks 😎
J

rugged imp
silk pasture
#

@rugged imp 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

npm cache clean --force
rm -rf node_modules
npm ci

composer install --no-interaction --prefer-dist --optimize-autoloader --no-dev

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?

rugged imp
# silk pasture <@766328954503299083> We don't commit assets on main, only on the staging branch...

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.

silk pasture
#

Awesome - thanks @rugged imp .
You made our day!