What does ‘The jig is up.’ mean?

The jig is up.

( phr ) It’s all over; we/you are done in. The jig is up! You don’t work here any more.