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.
Trader Joe's: Car crashes into Long Island store, injuring 11
Selena Gomez drops F-bomb, walks off stage during Jingle Ball performance