From 3fedb7916bdbe9ea0cde6b669f48da7522bcc9cf Mon Sep 17 00:00:00 2001 From: Florencia Date: Thu, 27 Jun 2024 19:42:32 +0200 Subject: [PATCH 1/2] Fix in auth --- .github/workflows/cd.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 5f6a0ec..403bb76 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -14,12 +14,11 @@ jobs: uses: actions/checkout@v3 # Authenticate to Google Cloud - - name: Authenticate to Google Cloud - env: - GOOGLE_CREDENTIALS: ${{ secrets.GOOGLE_CREDENTIALS }} - run: | - echo "$GOOGLE_CREDENTIALS" > /tmp/google-credentials.json - gcloud auth activate-service-account --key-file=/tmp/google-credentials.json + - id: 'auth' + name: 'Authenticate to Google Cloud' + uses: 'google-github-actions/auth@v1' + with: + credentials_json: '${{ secrets.GOOGLE_CREDENTIALS }}' # Build and push Docker image - name: Build and push Docker image From 84004bea82a91212739efbc7fd849488ac61745f Mon Sep 17 00:00:00 2001 From: Florencia Date: Thu, 27 Jun 2024 19:47:25 +0200 Subject: [PATCH 2/2] Fixes in credentials --- .github/workflows/cd.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 403bb76..0479d7a 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -1,7 +1,7 @@ name: 'Continuous Delivery' on: - push: + pull_request: #TODO: For testing branches: - "main" @@ -26,8 +26,8 @@ jobs: CONTAINER_IMAGE_URL: ${{ secrets.CONTAINER_IMAGE_URL }} GCLOUD_REGION: ${{ secrets.GCLOUD_REGION }} run: | - docker build -t $CONTAINER_IMAGE_URL:latest . gcloud auth configure-docker $GCLOUD_REGION + docker build -t $CONTAINER_IMAGE_URL:latest . docker push $CONTAINER_IMAGE_URL:latest deploy: