It depends on the model and the base I'm doing. For normal trooper models I paint the model attached to the base first and then do the base after.
For characters like the
GMCA below, I paint the fig separately and then make the base and paint it separately. The fig is then pinned to the finished base. That way I can model the bases to be more complex and wont run into trouble with painting either.