Okay, I joined a gym so I can improve my MTB preformance. Wanna rip some legs off this year

Okay.... don't wanna get spanked as much this year.
Question is... its okay to do the Circut training before riding? Like lift weights for an hour, then go ride for 2 hours?