Most single-photon sources are based on irreversible dynamic processes. Therefore, they cannot be used in applications requiring the coherent exchange of quantum states between atoms and photons, such as long-distance quantum networking. We have realized a single-photon source with a strongly localized single calcium ion in an optical cavity. By deterministically controlling the coupling to a well-defined field mode, we have generated single-photon pulses with precisely defined shape and timing, a prerequisite for using photons to exchange quantum information between distant ions. The stream of photons we produce is uninterrupted over the storage time of the ion, typically many hours. The experiment opens up the field of ion-trap cavity-QED, with a wide range of applications in quantum information processing.