I had to change CI many times.
From jenkins to gitlab... From travis to github actions...
So I build this small project that helps me to change faster without touch in real CI logic.
https://github.com/rosineygp/mkdkr
I think your problem is bigger than mine, but this kind of approach can help you in the future.