This seems to be a common problem in Google Cloud Functions even without setting up a CI/CD for it. From what I’ve noticed, if the function was initially created through the Google Cloud console and you're trying to update it using the gcloud functions deploy
command, it results in that error. It seems like updating the function using the command works if it was initially created through the same command.
In addition to that, try using gcloud run deploy
in your config file and see if it would work as this command is used to create or update a Cloud Run service. Refer to this documentation for the deployment steps.