Developing future quantum communication may rely on the ability to engineer cavity-mediated interactions between photons and solid-state artificial atoms, in a deterministic way. Here, we report a set of technological and experimental developments for the deterministic coupling between the optical mode of a micropillar cavity and a quantum dot trion transition. We first identify a charged transition through in-plane magnetic field spectroscopy, and then tune the optical cavity mode to its energy via in-situ lithography. In addition, we design an asymmetric tunneling barrier to allow the optical trapping of the charge, assisted by a quasi-resonant pumping scheme, in order to control its occupation probability. We evaluate the generation of a positively-charged quantum dot through second order auto-correlation measurements of its resonance fluorescence, and the quality of light-matter interaction for these spin-photon interfaces is assessed by measuring the performance of the device as a single-photon source.