Skip to content

Commit

Permalink
Update google-cloudrun-docker.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
furkmak authored Oct 3, 2024
1 parent cdef170 commit 89ade8d
Showing 1 changed file with 10 additions and 22 deletions.
32 changes: 10 additions & 22 deletions .github/workflows/google-cloudrun-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ name: 'Build and Deploy to Cloud Run'
on:
push:
branches:
- main
- 'main'

env:
PROJECT_ID: 'legalqaapp' # TODO: update to your Google Cloud project ID
REGION: 'us-west1' # TODO: update to your region
SERVICE: 'legalappgh' # TODO: update to your service name
#WORKLOAD_IDENTITY_PROVIDER: 'projects/123456789/locations/global/workloadIdentityPools/my-pool/providers/my-provider' # TODO: update to your workload identity provider
WORKLOAD_IDENTITY_PROVIDER: 'projects/155962577594/locations/global/workloadIdentityPools/github/providers/my-repo' # TODO: update to your workload identity provider

jobs:
deploy:
Expand All @@ -55,34 +55,22 @@ jobs:
# Configure Workload Identity Federation and generate an access token.
#
# See https://github.com/google-github-actions/auth for more options,
# including authenticating via a JSON credentials file.
- id: 'auth'
name: 'Authenticate to Google Cloud'
uses: 'google-github-actions/auth@v2'
uses: 'google-github-actions/auth@v2' # google-github-actions/auth@v2
with:
credentials_json: '${{ secrets.GCP_CREDENTIALS }}' # Reference your saved GCP credentials secret
# including authenticating via a JSON credentials file.
#- id: 'auth'
# name: 'Authenticate to Google Cloud'
# uses: 'google-github-actions/auth@v2' # google-github-actions/auth@v2
# with:
# workload_identity_provider: '${{ env.WORKLOAD_IDENTITY_PROVIDER }}'
workload_identity_provider: '${{ env.WORKLOAD_IDENTITY_PROVIDER }}'

# BEGIN - Docker auth and build
#
# If you already have a container image, you can omit these steps.
#- name: 'Docker Auth'
# uses: 'docker/login-action@v3' # docker/login-action@v3
# with:
# username: 'oauth2accesstoken'
# password: '${{ steps.auth.outputs.auth_token }}'
# registry: '${{ env.REGION }}-docker.pkg.dev'
-
name: Login to GAR
uses: docker/login-action@v3
- name: 'Docker Auth'
uses: 'docker/login-action@v3' # docker/login-action@v3
with:
registry: us-west1-docker.pkg.dev
username: _json_key
password: ${{ secrets.GCP_CREDENTIALS }}
username: 'oauth2accesstoken'
password: '${{ steps.auth.outputs.auth_token }}'
registry: '${{ env.REGION }}-docker.pkg.dev'

- name: 'Build and Push Container'
run: |-
Expand Down

0 comments on commit 89ade8d

Please sign in to comment.