We propose a method for deterministic generation of entanglement between a quantum-dot spin and a photon. Entanglement is established by an elastic scattering event from a cavity that is strongly coupled to a singly charged quantum dot. Due to the elastic nature of the interaction, the energy of the photon does not become entangled with the quantum dot, eliminating the need for temporal postselection. We derive an analytical expression for fidelity of the generated entangled state and investigate its behavior under realistic experimental conditions. We show that entanglement fidelities exceeding 0.974 can be realized using currently achievable quantum-dot cavity quantum electrodynamics systems.