The Stark deceleration of OH radicals in both low-field-seeking and high-field-seeking levels of the rovibronic ${}^2Pi_{3/2},v=0,J=3/2$ ground state is demonstrated using a single experimental setup. Applying alternating-gradient focusing, OH radicals in their low-field-seeking ${}^2Pi_{3/2},v=0,J=3/2,f$ state have been decelerated from 345 m/s to 239 m/s, removing 50 % of the kinetic energy using only 27 deceleration stages. The alternating-gradient decelerator allows to independently control longitudinal and transverse manipulation of the molecules. Optimized high-voltage switching sequences for the alternating-gradient deceleration are applied, in order to adjust the dynamic focusing strength in every deceleration stage to the changing velocity over the deceleration process. In addition we have also decelerated OH radicals in their high-field-seeking ${}^2Pi_{3/2},v=0,J=3/2,e$ state from 355 m/s to 316 m/s. For the states involved, a real crossing of hyperfine levels occurs at 640 V/cm, which is examined by varying a bias voltage applied to the electrodes.