This occurs more than one would think. Aircraft carriers are deep draft vessels of over 40 feet/12 meters. The definitive answer is: it depends. In 1963 the USS Coral Sea was run aground off Oakland, apparently partly due to a faulty chart.
The USS Enterprise, the world’s first nuclear powered carrier, ran aground on live TV in San Francisco Bay in 1983. In both instances the ships were directly conned by harbor pilots but the CO is always considered responsible for his vessel.
Most always, if a ship runs aground, the captain is relieved of his command and his career ended, almost immediately. The Captain and probably the Navigation Officer will be relieved for cause. The Commodore of the Carrier Battle Group will claim lack of confidence in this case.
Well, the first thing that happens is that the Commanding Officer of the ship, always an O-6 Navy Captain, immediately realizes he/she will be relieved of command within hours. You just do NOT run ANY US Naval ship aground.
The protocol itself involves evaluating damage and mitigating problems such as water leaking into the people space. Normally it is just waiting for a high tide to lift the ship up. Tug boats will also help it free from grounding by rocking the ship back and forth. Ships also get lightened by offloading liquid stores such as bunker fuel for the ship’s engines, aviation gasoline for the aircraft, and jet fuel for the helicopters.
In the case of the USS Essex grounding at Roosevelt Roads, Puerto Rico, the whole Air Wing was briefed on procedures to further lighten the ship by flying off every airplane that could be made airworthy.

One of the problems with nuclear carriers in a grounding circumstance is silt or mud clogging up the water intakes that are used to cool the steam condensing systems for the nuclear reactors. This may cause a nuclear reactor to be shut down, manually or automatically. You do not abandon a multibillion dollar nuclear or diesel platform because it runs aground.
The outcome for commanding officers has not always been consistent. The captain of the USS Coral Sea, one of the finest combat aviators of his generation, was relieved of command and his career ended.
The captain of the USS Enterprise at the time of its grounding, Robert J. Kelly, who had already been selected for promotion to commodore, eventually became a four-star admiral and commander in chief of the U.S. Pacific Fleet. As noted, it depends.
