If the neck is especially stiff only when a migraine occurs, it is likely that the migraine is causing the stiff neck and not vice versa.
So the treatment would be treatment of the migraine. If the neck is chronically stiff, seeing a physiotherapist may help.