Upgrading Ubuntu LTS versions has been quite smooth over the years in my experience. I had servers moving from 18 to 20 to 22 and soon 24 LTS, without troubles. This guide on the command line looks good, but lacks the version parameter for the upgrade target: https://www.cyberciti.biz/faq/upgrade-ubuntu-18-04-to-20-04-lts-using-command-line/
In your case, I’d suggest stopping at 20 LTS, and see which GitLab version upgrades are up next. Then consider upgrading to 22 LTS and later.