title: ERROR: (gcloud.functions.deploy) message=Build failed: function.js does not exist
body: <p>I am trying to deploy a simple function in Cloud Builds through a yaml file. This function lives in Github and the Cloud Build trigger point at my repository in order to deploy it.
  Cloud Build invokes my yaml file without problems but suddenly I get this error</p>
  <pre><code>ERROR: (gcloud.functions.deploy) OperationError: code=3, message=Build failed: function.js does not exist; Error ID: 7485c5b6
  </code></pre>
  <p>I am not sure why gcloud function deploy is looking for a function.js file when as far as I understand, it just searches for the index.js file.
  The files that I have are:</p>
  <ul>
  <li>index.js</li>
  <li>cloudbuild.yaml</li>
  <li>package.json</li>
  <li>package-lock.json</li>
  </ul>
  <p>The function deploys successfully through gcloud cli so my bet is that the error exists in the yaml file but it might also be some config in Cloud Build. Here how yaml file looks:</p>
  <pre><code>steps:
    - name: &quot;gcr.io/cloud-builders/gcloud&quot;
      args:
        - functions
        - deploy
        - webhook
        - --source=.
        - --trigger-http
        - --runtime=nodejs12
        - --region=europe-west2
        - --allow-unauthenticated
  </code></pre>
  <p>Have somebody any clue of what could be happening? thanks!</p>