I found the solution.
As build artifact you need to publish, firebase.json, .firebaserc and whole functions folder including package.json (without node_modules)
Then in release using sudo firebase deploy --token $(firebase-token) --project $(firebase-project) --only functions --force
I would look into Azure Functions. Create a gate trigger and enable azure function after a successful release.