For most of the past three years, Joe Keefe has been essentially homeless. The lead singer of the hard-touring Los Angeles folk-rock band Family of the Year spent so much time on the road that it didn’t seem worthwhile to spend money on an apartment. “When we weren’t touring, I would Airbnb a place for a couple of weeks or head back east to visit mom,” he tells The Post.

But since their melancholic 2012 track “Hero” caught the attention of director Richard Linklater, who then included it in his Oscar-nominated movie “Boyhood,” Keefe and the group have enjoyed a sudden rise in profile.

At the Golden Globes this past Sunday, the song played whenever a “Boyhood” winner took the stage— resulting in an audience of nearly 21 million people hearing it three times throughout the night.

It’s now racked up almost 30 million Spotify plays, hit No. 1 on Billboard’s Adult Alternative Chart and as a result, Keefe and his band mates have enjoyed a much-need infusion of cash. “I just rented a house,” he adds. “It’s the first time I’ve had a base camp I can call my own. And it’s mostly because of ‘Hero.’ ”

“ ‘Hero’ was a song I wrote partly about feeling daunted about the responsibility that comes with growing up,” remembers Keefe. “It felt a little scary to sing because it was so emotionally raw.”The group, consisting of Keefe, his drummer brother Sebastian, keyboardist/vocalist Christina Schroeter and guitarist/vocalist James Buckey, formed in 2009, but their major label debut, “Loma Vista” (which included “Hero”), arrived in 2012.

A member of Linklater’s staff made him aware of “Hero” and the director was impressed enough to ask Family of the Year if he could use it in “Boyhood” during a scene in which lead character Mason heads off to college for the first time.

But, as Keefe explains, it almost didn’t happen. “Richard told me that the song was almost too perfect and that he was worried it hit the nail on the head a little too hard. But he went with it and we’re glad he did!”

The quartet have also had the opportunity to share in the success of “Boyhood.” In 2014, the band was invited to a preview screening in Amsterdam where they played “Hero.” And prior to Sunday’s Golden Globes, they caught up with Linklater and the “Boyhood” cast at a glitzy party at LA’s Chateau Marmont hotel.

With Oscar glory beckoning for “Boyhood,” they might get a further taste of Tinseltown’s award season magic. “If we’re invited to any Oscar parties, we will definitely come,” says Keefe. “Everybody wants to do the Hollywood thing once!”