Gravity is well described with general relativity, which is a classical theory dealing with four dimensional space time, where the effect we call gravity is a distortion of this space time. This distortion depends on the energy momentum vector of the item under study, and it holds true also in the case of photons, which though of zero mass, have energy =h*nu, nu the frequency and h Planck's constant, and a large number of them build up the classical electromagnetic wave. That photons do interact with gravity, is seen in gravitational lensing.
The exact way is still a research project. If you have access to the publication through a library
The gravitational field of photons
W. B. Bonnor
The gravitational field of a photon on an infinite straight path is a single sheet of plane-fronted gravitational wave accompanying the photon and perpendicular to its track. This field cannot arise from a retarded potential generated by the photon, and I suggest that it arises in the process of emission. The near-field depends on the energy of the photon, but the far-field does not. The field of a steady beam of photons is compared with that of a static material rod, and the differences discussed.
The photon itself has no electric or magnetic field when measured, but in the mathematical expression that builds up the electromagnetic wave there are phases in complex amplitudes that generate the classical electromagnetic field, light.
A complete description for the photon's gravitational identity has to wait for the quantization of gravity. At the moment these are effective theories . One point should be clear that both the photon and the gravitational wave will be travelling with velocity c.
see also answers here.