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.
'Duck Dynasty's Phil Robertson on indefinite hiatus after anti-gay remarks
WATCH: Romney realizes he's going to lose the election in Netflix's trailer