Deploy to Google App Engine with GitHub Repo

I’m learning how to use the Google App Engine, and I can deploy it normally through the terminal, but I want to let people contribute to my github repository, and everything they publish will update my application. Here is my repo:

https://github.com/rajtastic/roshanissuperveryawesome

I synchronized the repository with the application engine and can see its contents in my Cloud instance

enter image description here

My question is:

  • How do I deploy a new version of my application when I commit in my repo?

Does anyone know if this is possible?

+8
source share
4 answers

It looks like the original push-to-deploy function is now deprecated, but you can use the Google Cloud Platform Build Trigger to do this:

Go to the Google Cloud Platform> Container Registry> Build Triggers and configure the branches that you want to automatically build from the connected github repository.

Make sure you add the assembly definition to your repository. [1] has the full specification, but here is an example of a minimum for gcloud deploy cloudbuild.yaml through cloudbuild.yaml :

 steps: - name: 'gcr.io/cloud-builders/gcloud' args: ['app', 'deploy'] 

[1] https://cloud.google.com/container-builder/docs/tutorials/creating-a-custom-build-step

+9
source

It seems that this is impossible. It looks like you need to deploy through the shell somewhere (Google Cloud Shell will not work, I don’t think it can be automated). Codeship.com can do this, and it works very well for me:

https://documentation.codeship.com/basic/continuous-deployment/deployment-to-google-app-engine/


+4
source

It should be possible now with GitHub Actions (October 2018).

GitHub Actions allows you to connect and share containers to start the software development workflow. Easily build, package, release, upgrade and deploy your project in any language - on GitHub or on any external system - without having to run the code yourself.

See the steps :

Workflows can be triggered by GitHub platform events (i.e. Push, Issue, Release) and can trigger a sequence of sequential or parallel actions in response. Combine and customize actions for services you know and love, created and maintained by the community.

+2
source

I have written a comprehensive guide that you can follow to get your Github app on the Google Cloud continuously delivered using Github Actions.


In short, here is the main.workflow configuration you need

 workflow "build & deploy" { resolves = ["gcloud deploy"] on = "push" } action "filter master" { uses = "actions/bin/ filter@master " args = "branch master" } action "install node_modules" { uses = "nuxt/ actions-yarn@master " needs = ["filter master"] args = "install" } action "build static files" { uses = "nuxt/ actions-yarn@master " needs = ["install node_modules"] args = "build" } action "gcloud auth" { uses = "actions/gcloud/ auth@master " secrets = ["GCLOUD_AUTH"] needs = ["build static files"] } action "gcloud deploy" { uses = "actions/gcloud/ cli@master " needs = ["gcloud auth"] runs = "gcloud app deploy β€” project=<PROJECT-ID>" } 
0
source

Source: https://habr.com/ru/post/1261808/


All Articles