"Astronaut" was an allusion to the Argonauts of Greek mythology, who accompanied the hero Jason in search of the Golden Fleece. "Argonauts" translates as "sailors of the Argo," which was the ship that Jason sailed in quest of the Golden Fleece. There was already a 19th century ship in the British royal navy called the HMS Argonaut, which might explain how a British writer like Greg ended up coining a word like "astronaut."
Eventually, by the late 1920s, the word "astronaut" evolved from being the name of a spaceship to referring to the people who traveled in those spaceships.
According to Movers and Shakers: A Chronology of Words that Shaped Our Age, the earliest reference to the word "astronaut" can be found in a 1929 quote from a British scientific journal shown below: