Good question!
Some time ago I think there was a thread somewhat similar to this about oil rigs.
And If I remember they hung a ground rod in the water........,but who am I to say.
(A) Grounding of Electrical and Nonelectrical Parts. Ground-
ing of both electrical and nonelectrical parts in a floating building
shall be through connection to a grounding bus in the building
panelboard.