Circuit quantum electrodynamics allows spatially separated superconducting qubits to interact via a quantum bus, enabling two-qubit entanglement and the implementation of simple quantum algorithms. We combine the circuit quantum electrodynamics architecture with spin qubits by coupling an InAs nanowire double quantum dot to a superconducting cavity. We drive single spin rotations using electric dipole spin resonance and demonstrate that photons trapped in the cavity are sensitive to single spin dynamics. The hybrid quantum system allows measurements of the spin lifetime and the observation of coherent spin rotations. Our results demonstrate that a spin-cavity coupling strength of 1 MHz is feasible.