work (one's) passage
To do work in exchange for free travel to a specific town or country. After his company went bust in Los Angeles, Martin had to work his passage back to his family's home in Britain.
work your passage
work in return for a free place on a voyage.