Update Cloud Run example workflow

This commit is contained in:
Seth Vargo 2020-03-31 14:28:53 -04:00
parent f4b29e961b
commit 79b8076cbc
No known key found for this signature in database
GPG key ID: C921994F9C27E0FF
4 changed files with 210 additions and 176 deletions

View file

@ -32,29 +32,29 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v1
uses: actions/checkout@v2
# Setup gcloud CLI
- uses: GoogleCloudPlatform/github-actions/setup-gcloud@master
with:
version: '275.0.0'
version: '286.0.0'
service_account_email: ${{ secrets.SA_EMAIL }}
service_account_key: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS}}
# Configure gcloud CLI
- name: gcloud Set up
run: |
gcloud config set project $PROJECT_ID
service_account_key: ${{ secrets.SA_KEY}}
project_id: ${{ secrets.RUN_PROJECT }}
# Build and push image to Google Container Registry
- name: Build
run: |
gcloud builds submit -t gcr.io/$PROJECT_ID/$SERVICE_NAME:$GITHUB_SHA
gcloud builds submit \
--quiet \
--tag "gcr.io/$PROJECT_ID/$SERVICE_NAME:$GITHUB_SHA"
# Deploy image to Cloud Run
- name: Deploy
run: |
gcloud run deploy $SERVICE_NAME \
--region $RUN_REGION \
--image gcr.io/$PROJECT_ID/$SERVICE_NAME:$GITHUB_SHA \
--platform managed
run: |-
gcloud run deploy "$SERVICE_NAME" \
--quiet \
--region "$RUN_REGION" \
--image "gcr.io/$PROJECT_ID/$SERVICE_NAME:$GITHUB_SHA" \
--platform "managed" \
--allow-unauthenticated