Run linking logic before deploying

closes #286