Chasing Gravitational Waves with the Cherenkov Telescope Array