Addressing the origin of the astrophysical neutrino flux observed by IceCube is of paramount importance. Gamma-Ray Bursts (GRBs) are among the few astrophysical sources capable of achieving the required energy to contribute to such neutrino flux through p$gamma$ interactions. In this work, ANTARES data have been used to search for upward going muon neutrinos in spatial and temporal coincidence with 784 GRBs occurred from 2007 to 2017. For each GRB, the expected neutrino flux has been calculated in the framework of the internal shock model and the impact of the lack of knowledge on the majority of source redshifts and on other intrinsic parameters of the emission mechanism has been quantified. It is found that the model parameters that set the radial distance where shock collisions occur have the largest impact on neutrino flux expectations. In particular, the bulk Lorentz factor of the source ejecta and the minimum variability timescale are found to contribute significantly to the GRB-neutrino flux uncertainty. For the selected sources, ANTARES data have been analysed, by maximising the discovery probability of the stacking sample through an extended maximum-likelihood strategy. Since no neutrino event passed the quality cuts set by the optimisation procedure, 90% confidence level upper limits (with their uncertainty) on the total expected diffuse neutrino flux have been derived, according to the model. The GRB contribution to the observed diffuse astrophysical neutrino flux around 100 TeV is constrained to be less than 10%.