Deploy to Google App Engine via a GitHub Repo

2019-04-07 02:49发布

I'm learning how to use Google App Engine and I can deploy fine via terminal but I want to allow people to contribute to my github repo and anything they publish will update my app. Here is my repo:

https://github.com/rajtastic/roshanissuperveryawesome

I've sync'd my repo to app engine and I can see the contents in my Cloud instance

enter image description here

My question is:

  • How do I deploy a new version of my app whenever I commit to my repo?

Does anyone know if this is possible?

3条回答
劫难
2楼-- · 2019-04-07 03:44

That should be possible now with GitHub Actions (Oct. 2018).

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

See Actions:

Workflows can be triggered by GitHub platform events (i.e. push, issue, release) and can run a sequence of serial or parallel actions in response. Combine and configure actions for the services you know and love built and maintained by the community.

查看更多
唯我独甜
3楼-- · 2019-04-07 03:51

Looks like the original push-to-deploy feature is now deprecated, but you can use Google Cloud Platform's Build Trigger to do this:

Navigate to Google Cloud Platform > Container Registry > Build Triggers and set up the branch(es) you want to auto build from your connected github repository.

Make sure you've added a build definition to your repository. [1] has the full specification, but here's an example of the bare minimum to do a gcloud deploy via 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

查看更多
迷人小祖宗
4楼-- · 2019-04-07 03:54

it seems that this is not possible. It looks like you need to deploy via a shell somewhere (Google Cloud Shell won't work I don't think as it can't be automated). Codeship.com can do it and I have it working very nicely:

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


查看更多
登录 后发表回答