mirror of
https://github.com/google-github-actions/setup-gcloud.git
synced 2026-08-21 15:29:24 +00:00
|
|
||
|---|---|---|
| .. | ||
| .github/workflows | ||
| src | ||
| .gcloudignore | ||
| app.yaml | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
| tsconfig.json | ||
App Engine - GitHub Actions
An example workflow that uses GitHub Actions to deploy a Hello World Node.js (TypeScript) app to App Engine. It also shows how to make App Engine to compile your app.
Workflow
For pushes to the default branch, master, the workflow will:
-
Verify the Google Cloud Platform credentials are correct.
-
Deploy the app to App Engine.
Setup
-
Create or reuse a GitHub repository for the example workflow:
-
Move into your repository directory.
-
Copy the example into the repository:
cp -r <path_to>/github-actions/example-workflows/gae/ ./
* `App Engine Deployer`: allows write access only to deploy and create a new version
* `App Engine Service Admin`: allows it to split or migrate traffic and start the new and stop an old version
* `Cloud Build Service Account - roles/cloudbuild.builds.builder`: allows for running and manipulating Cloud Build and Storage resources
* `Cloud Build Editor - roles/cloudbuild.builds.editor`: allows for deploying cloud builds
* `Service Account User - roles/iam.serviceAccountUser`: actAs requirement
`Browser - roles/browser` may or may not also required to allow for viewing and inserting items to the project (needed for Storage access).
-
Fill in the repository's secret: *
PROJECT_IDYour Project Id *GOOGLE_APPLICATION_CREDENTIALSService Account Key -
Enable the App Engine API and Cloud Build API..
-
Create Google App Engine project running
gcloud app createin your console.
Run the workflow
- Add and commit your changes:
git add .
git commit -m "Set up GitHub workflow"
- Push to the
masterbranch:
git push origin master
- View the workflow by selecting the
Actionstab at the top of your repository. Then click on theDeploy to App Engineworkflow to see the details.