Is it possible to only deploy specific Firebase functions that changed with GitLab CI/CD?

Viewed 116

Deploying all Firebase functions at once is quite easy with GitLab CI/CD (How to leverage GitLab CI/CD for Google Firebase):

deploy-functions:
  stage: deploy
  script:
    - cd functions
    - npm install
    - cd ..
    - firebase deploy --only functions --token $FIREBASE_TOKEN
  only:
    refs:
      - master
    changes:
      - functions/**/*

However, when "deploying large numbers of functions, you may exceed the standard quota and receive HTTP 429 or 500 error messages. To solve this, deploy functions in groups of 10 or fewer." (see Manage functions deployment and runtime options).

With the Firebase CLI, specific functions (e.g. addMessage and makeUppercase) can be deployed using firebase deploy --only functions:addMessage,functions:makeUppercase.

Now, is there an easy way to automatically detect which functions are affected by changes in the code base and build a gitlab-ci.yml that only deploys the corresponding functions?

0 Answers
Related