mirror of
https://github.com/google-github-actions/setup-gcloud.git
synced 2026-08-24 15:09:21 +00:00
Update Cloud Run example workflow
This commit is contained in:
parent
f4b29e961b
commit
79b8076cbc
4 changed files with 210 additions and 176 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue