The deal includes an additional $500,000 in performance bonuses, in $100,000 increments for 10, 15, 20, 25 and 30 games started and $100,000 if he reaches 25, 35, 45, 55 and 60 relief appearances, sources told ESPN.
Dallas Keuchel became a free agent after the World Series and remains unsigned.
Miley, who has pitched for five different teams over the past five seasons, went 5-2 with a career-best 2.57 ERA and 50 strikeouts over 16 starts for the Milwaukee Brewers in 2018.
He missed almost three months of the 2018 season because of injuries, including a two-month span after going on the disabled list with an oblique injury in early May.
Known as a ground-ball pitcher who is armed with a nasty cutter, Miley made four postseason appearances, including just a five-pitch start against the Los Angeles Dodgers in Game 5 of the National League Championship Series -- as planned by manager Craig Counsell. In 14 2/3 postseason innings, he gave up only two earned runs and struck out nine.
He made $2.5 million in 2018.
Miley agreed to a minor league deal with the Brewers prior to the 2018 season, joining the club in late April after starting the season in Double-A Biloxi because of a groin injury late in spring training. In 2017, while with the Baltimore Orioles, he went 8-15 with a 5.61 ERA, 152 strikeouts and an American League-leading 93 walks.
He made his only All-Star Game appearance as a rookie for Arizona in 2012, when he won 16 games and was runner-up to Bryce Harper in Rookie of the Year voting. Overall, he is 71-76 with a 4.26 ERA in 216 appearances in his career, including 212 starts. In addition to Milwaukee, Baltimore and Arizona, he has also pitched for Seattle and Boston during his career.
ESPN's Jeff Passan and Buster Olney and The Associated Press contributed to this report.