0

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?

3
  • Hi @abc, Was my answer helpful to you? Commented Dec 6, 2021 at 9:46
  • Idk I decided to just use firebase functions Commented Dec 7, 2021 at 0:30
  • You can use cloud build linked with your Github repository for continuous deployment. I have written an article about this :- sushantdhiman.com/blog/2022/… Commented Jul 4, 2022 at 11:33

1 Answer 1

3

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.