Developing efficient, stable, and low-cost novel electron-cocatalysts is crucial for photocatalytic hydrogen evolution reaction. Herein, amorphous Ni-P alloy particles were successfully modified onto g-C3N4 to construct the Ni-P/ g-C3N4 photocatalyst through a simple and green triethanol-amine (TEOA)-mediated photodeposition method. It was found that the TEOA could serve as an excellent complexing agent to coordinate with Ni2+ to form [Ni(TEOA)]2+ complex, which can promote the rapid and effective deposition of amorphous Ni-P alloy on the g-C3N4 surface. Photocatalytic tests suggest that the hydrogen-evolution performance of g-C3N4 can be greatly promoted through integrating amorphous Ni-P alloy. Especially, the Ni-P/g-C3N4 (5 wt%) exhibits the superior H2-generation activity (118.2 μmol h-1 g-1), which is almost 35.8 times that of bare g-C3N4. Furthermore, the amorphous Ni-P alloy cocatalyst can also serve as the general hydrogen-production cocatalyst to greatly enhance the photocatalytic performance of traditional semiconductor materials such as TiO2 and CdS. Based on the present results, the mechanism of the amorphous Ni-P alloy as the high-efficiency electron transfer medium was proposed for the boosted H2-generation rate. The present facile route may broaden the horizons for the efficient development of highly active cocatalysts in photocatalytic field.