Miley (7-8) won for the third time in four starts, taking a shutout into the seventh inning and surviving 7 2/3. He walked three and struck out four.
Brad Ziegler, installed by the Diamondbacks as their closer earlier this week, allowed a hit in the ninth before picking up his fifth save.
Carlos Villanueva (2-7) was charged with the loss after giving up all three runs on six hits in five innings.
Video of Victoria’s Secret models trying to 'twerk' hits Instagram
Costly malfunction causes beer flood at Boston-area brewery