You can use the relativistic Doppler effect
The relativistic Doppler effect is the change in frequency (and wavelength) of light, caused by the relative motion of the source and the observer (as in the classical Doppler effect), when taking into account effects described by the special theory of relativity.
The relativistic Doppler effect is different from the non-relativistic Doppler effect as the equations include the time dilation effect of special relativity and do not involve the medium of propagation as a reference point. They describe the total difference in observed frequencies and possess the required Lorentz symmetry.
Before starting the journey, your ship needs to have a set of reference light sources, with known spectra. During the trip, by measuring those spectra, relative velocity can be calculated.
In the picture below, taken from the linked page, the top half shows what Doppler shift to expect according to the direction in which the observer is looking at the light source in the relativistic case, while the bottom one shows the Doppler shift in the non relativistic case.