Quantum thermodynamics in flows of light