Skip to content

Commit 08e2cec

Browse files
committed
Use creds from previous step
1 parent 5524116 commit 08e2cec

1 file changed

Lines changed: 5 additions & 18 deletions

File tree

.github/workflows/docker-build.yml

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -96,23 +96,12 @@ jobs:
9696
token_format: "access_token"
9797
create_credentials_file: true
9898

99-
- name: Print authentication info
99+
- name: Activate service account credentials
100100
run: |
101-
echo "Current authentication:"
102-
gcloud auth list
103-
# Print service account IAM bindings
104-
echo "Service account IAM bindings:"
105-
gcloud iam service-accounts get-iam-policy ${{ secrets.SUNSETTING_GCP_SERVICE_ACCOUNT }}
106-
107-
- name: Impersonate service account
108-
run: |
109-
# Get the service account email
110-
SA_EMAIL="${{ secrets.SUNSETTING_GCP_SERVICE_ACCOUNT }}"
111-
112-
echo "Impersonating service account: $SA_EMAIL"
113-
gcloud config set auth/impersonate_service_account $SA_EMAIL
101+
echo "Activating service account credentials"
102+
gcloud auth login --brief --cred-file="${{ steps.auth.outputs.credentials_file_path }}"
114103
115-
echo "Authentication after impersonation:"
104+
echo "Verifying authentication:"
116105
gcloud auth list
117106
118107
- name: Deploy to Google Cloud
@@ -129,6 +118,4 @@ jobs:
129118
--image ${IMAGE_REPO}:${IMAGE_TAG} \
130119
--region ${{ env.GCP_REGION }}
131120
--service-account ${{ secrets.SUNSETTING_GCP_SERVICE_ACCOUNT }} \
132-
--verbosity=debug
133-
echo "Deployed version `latest` (should be same as ${{ github.event.release.tag_name }}) to Google Cloud Run \
134-
service ${{ env.GCP_SERVICE_NAME }} in region ${{ env.GCP_REGION }}"
121+
echo "Deployed version `latest` (should be same as ${{ github.event.release.tag_name }}) to Google Cloud Run service ${{ env.GCP_SERVICE_NAME }} in region ${{ env.GCP_REGION }}"

0 commit comments

Comments
 (0)