According to dauntlessprivateers.org, there are five types of shanties:
Capstan shanties: Sung while raising anchor. Also known as "stamp and go chanties" because sailors would stomp the deck while turning the capstan.
Halyard shanties (Long Drag Shanty): Sung to the raising and lowering of sails. The crew would rest during the verse and haul during the chorus.
Short drag shanties: Very difficult tasks meant crews could pull less. Short drag shanties were used for such tasks - such as trimming the sails or raising the masthead.
Windlass and pumping shanties: the windlass is also used to raise the anchor. Sailors would pump handles up and down, making the barrel of the windlass rotate to bring the anchor chain up. There were several different types of pumps, which accounts for the variation in the timing of pumping shanties.
Ceremonial shanties and forecastle songs: songs were those sung by sailors on their time off (of which they didn't have a great deal). Ceremonial shanties were for times of celebration, such as when the sailor paid off his debt to the ship or when they crossed the equator.
This website has this to say about Drunken Sailor:
The capstan shanty was a moderate tune sung to raising the anchor. In order to raise the anchor bars were inserted into the capstan and sailors would walk around it, turning the capstan to raise the anchor. Sailors would stamp on the deck on the words "Way Hay and Up She Rises."
I think the stomping rhythm and steady beat of the song makes it is clearly a Capstan Shanty — it doesn't seem to slow down or "rest" during the verse. So, I think it's most probably referring to the anchor rising…
Who knows though, I'm sure people have sung it to the sails too. ;)