From ab5cedaa60fde5716d4ab56f74cdf3c47082db1d Mon Sep 17 00:00:00 2001 From: spoonman01 Date: Thu, 19 Sep 2024 14:34:36 +0200 Subject: [PATCH] Update github-action ci step to v1 --- .github/workflows/prod.yml | 24 ++++++++++++++++-------- .github/workflows/staging.yml | 24 ++++++++++++++++-------- 2 files changed, 32 insertions(+), 16 deletions(-) diff --git a/.github/workflows/prod.yml b/.github/workflows/prod.yml index c108ea5..468a0b5 100644 --- a/.github/workflows/prod.yml +++ b/.github/workflows/prod.yml @@ -77,18 +77,26 @@ jobs: # delete bakup file rm "$SERVICE.yaml.bak" - # Setup gcloud CLI - - name: Set up Cloud SDK - uses: google-github-actions/setup-gcloud@v0 + - name: Enable auth plugin + run: | + echo "USE_GKE_GCLOUD_AUTH_PLUGIN=True" >> $GITHUB_ENV + # Auth to GKE + - name: Authenticate to GKE + uses: google-github-actions/auth@v1 with: - service_account_email: kubernetes-deployment-agent@wire-bot.iam.gserviceaccount.com - service_account_key: ${{ secrets.GKE_SA_KEY }} project_id: wire-bot - export_default_credentials: true + credentials_json: ${{ secrets.GKE_SA_KEY }} + service_account: kubernetes-deployment-agent@wire-bot.iam.gserviceaccount.com + + # Setup gcloud CLI + - name: Set up Cloud SDK + uses: google-github-actions/setup-gcloud@v1 - # Configure Docker to use the gcloud command-line tool - - name: Configure Docker Google cloud + # Prepare components + - name: Prepare gcloud components run: | + gcloud components install gke-gcloud-auth-plugin + gcloud components update gcloud --quiet auth configure-docker # Get the GKE credentials so we can deploy to the cluster diff --git a/.github/workflows/staging.yml b/.github/workflows/staging.yml index 3e6a9cf..0eae132 100644 --- a/.github/workflows/staging.yml +++ b/.github/workflows/staging.yml @@ -50,18 +50,26 @@ jobs: build-args: | release_version=${{ env.RELEASE_VERSION }} - # Setup gcloud CLI - - name: Set up Cloud SDK - uses: google-github-actions/setup-gcloud@v0 + - name: Enable auth plugin + run: | + echo "USE_GKE_GCLOUD_AUTH_PLUGIN=True" >> $GITHUB_ENV + # Auth to GKE + - name: Authenticate to GKE + uses: google-github-actions/auth@v1 with: - service_account_email: kubernetes-deployment-agent@wire-bot.iam.gserviceaccount.com - service_account_key: ${{ secrets.GKE_SA_KEY }} project_id: wire-bot - export_default_credentials: true + credentials_json: ${{ secrets.GKE_SA_KEY }} + service_account: kubernetes-deployment-agent@wire-bot.iam.gserviceaccount.com + + # Setup gcloud CLI + - name: Set up Cloud SDK + uses: google-github-actions/setup-gcloud@v1 - # Configure Docker to use the gcloud command-line tool - - name: Configure Docker Google cloud + # Prepare components + - name: Prepare gcloud components run: | + gcloud components install gke-gcloud-auth-plugin + gcloud components update gcloud --quiet auth configure-docker # Get the GKE credentials so we can deploy to the cluster