Flushing assets

When I’m putting a new version of my site online, I want all the assets to be re-generated. What’s the best way to do this? I’m using cloud hosting so I don’t have FTP/SSH access. I could make a controller that loops all subfolders and removes them, but isn’t there a better way?

What I do is not copy the assets folder to the server. They will be re-generated individually whenever a requiring view needs them.

Edit: and if it’s an update, I delete the assets subfolders.

Wait, do you mean you cannot delete a folder, even in web directory mode?

Well I could make a model/controller that deletes the assets… but I was wondering if there wasn’t a better way like Yii::AssetManager->flush() or something. I heard it could be done with a git hook so maybe I’ll look into that.

It would be nice if Yii was aware of an update and automatically could run some tasks…