Skip to content

Commit

Permalink
Update auth library
Browse files Browse the repository at this point in the history
  • Loading branch information
RafikFarhad committed Dec 21, 2023
1 parent 535b7e1 commit 7ca9ac8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/build_and_push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ jobs:
- uses: actions/checkout@v3
- name: Authenticate to Google Cloud
id: auth
uses: google-github-actions/auth@v0
uses: google-github-actions/auth@v2
with:
workload_identity_provider: projects/331888282073/locations/global/workloadIdentityPools/push-to-gcr-pool/providers/gh-action
service_account: push-to-gcr-storage-object-adm@pro-chesta.iam.gserviceaccount.com
- name: Building and pushing the image
uses: ./
# uses: RafikFarhad/push-to-gcr-github-action@v5-rc1 # <- use this on your workflow
with:
# gcloud_service_key: ${{ secrets.JSON_GCLOUD_SERVICE_ACCOUNT_JSON }} # <- not needed when used with google-github-actions/auth@v0
# gcloud_service_key: ${{ secrets.JSON_GCLOUD_SERVICE_ACCOUNT_JSON }} # <- not needed when used with google-github-actions/auth@v2
registry: gcr.io
project_id: pro-chesta
image_name: hello-world-by-push-to-gcr-0
Expand All @@ -42,14 +42,14 @@ jobs:
- uses: actions/checkout@v3
- name: Authenticate to Google Cloud
id: auth
uses: google-github-actions/auth@v0
uses: google-github-actions/auth@v2
with:
credentials_json: '${{ secrets.B64_GCLOUD_SERVICE_ACCOUNT_JSON }}'
- name: Building and pushing the image
uses: ./
# uses: RafikFarhad/push-to-gcr-github-action@v5-rc1 # <- use this on your workflow
with:
# gcloud_service_key: ${{ secrets.JSON_GCLOUD_SERVICE_ACCOUNT_JSON }} # <- not needed when used with google-github-actions/auth@v0
# gcloud_service_key: ${{ secrets.JSON_GCLOUD_SERVICE_ACCOUNT_JSON }} # <- not needed when used with google-github-actions/auth@v2
registry: gcr.io
project_id: pro-chesta
image_name: hello-world-by-push-to-gcr-1
Expand Down Expand Up @@ -91,15 +91,15 @@ jobs:
# this step mimics your build step which produce a docker image that will be pushed to gcr
- name: Authenticate to Google Cloud
id: auth
uses: google-github-actions/auth@v0
uses: google-github-actions/auth@v2
with:
workload_identity_provider: projects/331888282073/locations/global/workloadIdentityPools/push-to-gcr-pool/providers/gh-action
service_account: push-to-gcr-storage-object-adm@pro-chesta.iam.gserviceaccount.com
- name: Building and pushing the image
- name: Pushing the image
uses: ./
# uses: RafikFarhad/push-to-gcr-github-action@v5-rc1 # <- use this on your workflow
with:
# gcloud_service_key: ${{ secrets.JSON_GCLOUD_SERVICE_ACCOUNT_JSON }} # <- not needed when used with google-github-actions/auth@v0
# gcloud_service_key: ${{ secrets.JSON_GCLOUD_SERVICE_ACCOUNT_JSON }} # <- not needed when used with google-github-actions/auth@v2
registry: gcr.io
project_id: pro-chesta
image_name: hello-world-by-push-to-gcr-3
Expand All @@ -121,7 +121,7 @@ jobs:
type: [0, 1, 2]
steps:
- name: Authenticate to Google Cloud
uses: google-github-actions/auth@v0
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.JSON_GCLOUD_SERVICE_ACCOUNT_JSON }}
- name: Testing the image
Expand All @@ -141,7 +141,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Authenticate to Google Cloud
uses: google-github-actions/auth@v0
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.JSON_GCLOUD_SERVICE_ACCOUNT_JSON }}
- name: Delete images
Expand Down
2 changes: 1 addition & 1 deletion ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ jobs:
- uses: actions/checkout@v3
- name: Authenticate to Google Cloud
id: auth
uses: google-github-actions/auth@v0
uses: google-github-actions/auth@v2
with:
workload_identity_provider: projects/123123123/locations/global/workloadIdentityPools/the-workload-pool/providers/the-provider
service_account: only-storage-object-adm@<PROJECT_ID>.iam.gserviceaccount.com
Expand Down

0 comments on commit 7ca9ac8

Please sign in to comment.