Miley helps Diamondbacks beat Astros 3-1