abc
abc

Reputation: 1559

Deploying a Google Cloud Function written in typescript

I have written a cloud function using typescript and @google-cloud/functions-framework. My current workflow is to npm install, tsc (typescript compile), then functions-framework --source=build/src/ --target=index. Then I can visit http://localhost:8080/ to run my function.

Once I have mirrored my GitHub repo on GCP, how do I get my code to build and redeploy future commits?

Upvotes: 0

Views: 1844

Answers (1)

Akshansha Singhal
Akshansha Singhal

Reputation: 862

To deploy the function from your source repository, use the below command:

gcloud functions deploy NAME \
  --source https://source.developers.google.com/projects/PROJECT_ID/repos/REPOSITORY_ID/moveable-aliases/master/paths/SOURCE \
  --runtime RUNTIME \
  TRIGGER... \
  [FLAGS...]

For more information on this, checkout the doc here.

Upvotes: 3

Related Questions