Periodic and stationary solutions for compressible Navier-Stokes equations via a stability method