A machine-learning pipeline for real-time detection of gravitational waves from compact binary coalescences