We present the results of 2D, moving-mesh, viscous hydrodynamical simulations of an accretion disc around a merging supermassive black hole binary (SMBHB). The simulation is pseudo-Newtonian, with the BHs modeled as point masses with a Paczynski-Wiita potential, and includes viscous heating, shock heating, and radiative cooling. We follow the gravitational inspiral of an equal-mass binary with a component mass M bh = 10 6 M from an initial separation of 60r g (where r g ≡ GM bh /c 2 is the gravitational radius) to the merger. We find that a central, low-density cavity forms around the binary, as in previous work, but that the BHs capture gas from the circumbinary disc and accrete efficiently via their own minidiscs, well after their inspiral outpaces the viscous evolution of the disc. The system remains luminous, displaying strong periodicity at twice the binary orbital frequency throughout the entire inspiral process, all the way to the merger. In the soft X-ray band, the thermal emission is dominated by the inner edge of the circumbinary disc with especially clear periodicity in the early inspiral. By comparison, harder X-ray emission is dominated by the minidiscs, and the light curve is initially more noisy but develops a clear periodicity in the late inspiral stage. This variability pattern should help identify the EM counterparts of SMBHBs detected by the space-based gravitational-wave detector LISA.