Photo credit: Dane County Jail
The jig is up as defined by Merriam-Webster.
The origin, according to Know Your Phrase:
The phrase's origins apparently come from a time where the word jig was slang for a trick. Additionally, the Facts on File Encyclopedia of Word and Phrase Origins, by Robert Hendrickson, states that this expression was used during Elizabethan times (mid-to-late 16th century), where the word jig became slang for a practical joke or trick. Thus, if "the jig was up," it meant your trick was found out, or exposed.