@@ -77,13 +77,12 @@ for more information.
7777There are a few ways to authenticate this action. The caller must have
7878permissions to access the secrets being requested.
7979
80- Roles needed :
80+ [ Roles needed](https://cloud.google.com/appengine/docs/standard/python/roles#predefined_roles) :
8181
82+ - App Engine Admin (`roles/appengine.appAdmin`) : can manage all App Engine resources
83+ - Service Account User (`roles/iam.serviceAccountUser`) : to deploy as the service account
8284- Storage Admin (`roles/compute.storageAdmin`) : to upload files
8385- Cloud Build Editor (`cloudbuild.builds.editor`) : to build the application
84- - App Engine roles :
85- - Deployer (`roles/appengine.deployer`) : Can deploy but can not promote
86- - Admin (`roles/appengine.appAdmin`) : Can manage all App Engine resources (not recommended)
8786
8887*Note:* An owner will be needed to create the App Engine application
8988
@@ -133,6 +132,75 @@ only works using a custom runner hosted on GCP.**
133132The action will automatically detect and use the Application Default
134133Credentials.
135134
135+ # # Example Workflows
136+
137+ * [Deploy from source](#deploy-from-source)
138+
139+ # ## Setup
140+
141+ 1. Clone this repo.
142+
143+ 1. Create a new Google Cloud Project (or select an existing project).
144+
145+ 1. [Initialize your App Engine app with your project](https://cloud.google.com/appengine/docs/standard/nodejs/console#console).
146+
147+ 1. [Create a Google Cloud service account][sa] or select an existing one.
148+
149+ 1. Add the the following [Cloud IAM roles][roles] to your service account :
150+
151+ - ` App Engine Admin` - allows for the creation of new App Engine apps
152+
153+ - ` Service Account User` - required to deploy to App Engine as service account
154+
155+ - ` Storage Admin` - allows upload of source code
156+
157+ - ` Cloud Build Editor` - allows building of source code
158+
159+ 1. [Download a JSON service account key][create-key] for the service account.
160+
161+ 1. Add the following [secrets to your repository's secrets][gh-secret] :
162+
163+ - `GCP_PROJECT` : Google Cloud project ID
164+
165+ - `GCP_SA_KEY` : the downloaded service account key
166+
167+ # ## Deploy from source
168+
169+ To run this workflow, push to the branch named `example` :
170+
171+ ` ` ` sh
172+ git push YOUR-FORK main:example
173+ ` ` `
174+
175+ # # Migrating from `setup-gcloud`
176+
177+ Example using `setup-gcloud` :
178+
179+ ` ` ` YAML
180+ - name: Setup Cloud SDK
181+ uses: google-github-actions/[email protected] 182+ with:
183+ project_id: ${{ env.PROJECT_ID }}
184+ service_account_key: ${{ secrets.GCP_SA_KEY }}
185+
186+ - name: Deploy to App Engine
187+ run: gcloud app deploy app.yaml --quiet --no-promote --version v1
188+
189+ ` ` `
190+
191+ Migrated to `deploy-appengine` :
192+
193+ ` ` ` YAML
194+ - name: Deploy to App Engine
195+ uses: google-github-actions/[email protected] 196+ with:
197+ deliverables: app.yaml
198+ project_id: ${{ secrets.GCP_PROJECT }}
199+ credentials: ${{ secrets.GCP_SA_KEY }}
200+ promote: false
201+ version: v1
202+ ` ` `
203+
136204[gae] : https://cloud.google.com/appengine
137205[sm] : https://cloud.google.com/secret-manager
138206[sa] : https://cloud.google.com/iam/docs/creating-managing-service-accounts
0 commit comments