An updated version of this example can be found here
There are a couple preliminary steps that you'll need to take prior to creating your deployment workflow.
- Create a service account and download the json private key file. Be sure you don't commit this file to your repo on accident! Best practice is to minimize the number of permissions this service account has, but for getting setup, you can give the service account project owner permissions and figure out exactly what scope is appropriate later. Click here for docs on creating a service account: https://cloud.google.com/iam/docs/creating-managing-service-account-keys#iam-service-account-keys-create-console
- Open a new terminal and cd into the folder your keyfile is located in, then run the following command: