A year ago, Anthony Ramos was getting big-screen time as Lady Gaga’s gay BFF in “A Star Is Born.” And Mother Monster once gave him some wise advice on his own dreams of pop fame.

Recalls Ramos, 27: “She said, ‘Yo, remember those times when you’re just playing in small rooms. The moments I remember the most are when I was lugging my keyboard on my back, playing three clubs in a night sometimes. Just cherish those moments, man.’ ”

Now the Brooklyn son’s star is clearly on the rise: His debut album, “The Good & the Bad” — a Bruno Mars-esque mix of pop, soul and funk, with a dash of Latin flavor — drops Friday. Then he’ll play a hometown show at Music Hall of Williamsburg on Nov. 6.

Beyond his blossoming recording career, Ramos, one of the original stars of “Hamilton” — and cast member of Netflix’s “She’s Gotta Have It” series — recently wrapped his lead role in the film version of the musical “In the Heights,” due next summer.

Growing up in the Bushwick projects, all of this would have seemed like an impossible dream, even for someone who lost himself in the music of everyone from Eminem and Usher to Marc Anthony.

“The one thing that people could not take away from me was music,” says Ramos, who’s of Puerto Rican descent. “Thank God I had enough money to get a CD player. I always used to buy bootleg CDs from the dude right next door to this barbershop I used to go to.”

At the urging of a high-school musical director, Ramos went to the American Musical and Dramatic Academy in New York. “I didn’t know s -  - t about musical theater,” he says. “I wanted to play baseball.”

Ramos certainly learned well: In 2015, he originated the dual roles of young Philip Hamilton and anti-slavery activist John Laurens in “Hamilton.” He forged a bond with the Tony-winning show’s creator, Lin-Manuel Miranda, that continues today, with Ramos inheriting the “In the Heights” role that Miranda played on Broadway.

Ramos with Lin-Manuel Miranda in April 2018.
Ramos with Lin-Manuel Miranda in April 2018.Getty Images

“It’s nice to have friends who are geniuses,” he says of Miranda. “It’s amazing that he handed over this role that meant so much for him to play, and basically was like, ‘I’ma trust you with this.’”

“Hamilton” made some other life-changing connections for Ramos. It was on set that he met Will Wells, executive producer of “The Good & the Bad,” who also served as a co-writer and musician on the album.

Even more significantly, “Hamilton” played matchmaker for Ramos and Jasmine Cephas Jones, his fellow cast member and Brooklyn native. The two got engaged last Christmas Eve and plan to marry next year in the borough they still call home.

They also co-star in the video for Ramos’ sexy new single “Mind Over Matter,” which shows them getting freaky in the kitchen. “I had this idea for this video,” he says, “and she goes, ‘Well, you ain’t doin’ that with no video vixen!’ ”

As he releases his debut LP, Ramos has already won a Grammy, thanks to “Hamilton,” for Best Musical Theater Album. And he’s grateful: ” ‘Hamilton’ is the gift that keeps on giving, for sure.”