Using the path-integral formalism, we show that photons possess a nontrivial quantum metric in momentum space. We derive the semiclassical action and equations of motion by taking into account the quantum metric. In media with a spatially varying refractive index n(x), the quantum metric induces a shift in the trajectory of light at second order in spatial gradients of n, whose transverse component may be regarded as a nonlinear Hall effect of light. The quantum metric also gives rise to corrections to photon propagation relevant to gravitational lensing in curved spacetime at second order in wavelength, including a gravitational nonlinear Hall effect arising from the interplay between the geometry of position space and that of momentum space.