Aircraft carriers aren’t exactly the most discreet of ships. It’s difficult to hide them, particularly when they’re tied up in port, and you can bet every world government with any kind of intelligence service at all has someone living near the various Navy ports with a good view of the harbor and a surprisingly-high-quality set of binoculars. This information is nothing that can’t be found out in a couple of hours and a few phone calls anyway.
I worked as a navy contractor for a few years and at that time (mid 90s) the information as to when a ship was in port was classified confidential. We always found this amusing because information as to when it was deployed was not classified.
I don’t know if they still classify that info but easy to obtain or not, if it’s classified it’s classified.