From ad75ce6bb42ba44571f238555e000daa6d7f6edd Mon Sep 17 00:00:00 2001 From: faucomte97 Date: Wed, 20 Dec 2023 14:32:43 +0000 Subject: [PATCH 1/8] Test if step is required --- .github/workflows/deploy_dev.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/deploy_dev.yml b/.github/workflows/deploy_dev.yml index 264c508..0d6c68c 100644 --- a/.github/workflows/deploy_dev.yml +++ b/.github/workflows/deploy_dev.yml @@ -39,11 +39,11 @@ jobs: python-version: "3.8.x" architecture: "x64" - - id: gcauth - name: Authenticate to Google Cloud - uses: google-github-actions/auth@v2 - with: - credentials_json: ${{ secrets.GCLOUD_AUTH }} +# - id: gcauth +# name: Authenticate to Google Cloud +# uses: google-github-actions/auth@v2 +# with: +# credentials_json: ${{ secrets.GCLOUD_AUTH }} - name: Setup gcloud CLI uses: google-github-actions/setup-gcloud@v2 From 7d3af3cca685dbc26741d1617c1a8d615c794a82 Mon Sep 17 00:00:00 2001 From: faucomte97 Date: Wed, 20 Dec 2023 14:39:33 +0000 Subject: [PATCH 2/8] Test downgrading to version 1 --- .github/workflows/deploy_dev.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/deploy_dev.yml b/.github/workflows/deploy_dev.yml index 0d6c68c..370baa1 100644 --- a/.github/workflows/deploy_dev.yml +++ b/.github/workflows/deploy_dev.yml @@ -39,11 +39,11 @@ jobs: python-version: "3.8.x" architecture: "x64" -# - id: gcauth -# name: Authenticate to Google Cloud -# uses: google-github-actions/auth@v2 -# with: -# credentials_json: ${{ secrets.GCLOUD_AUTH }} + - id: gcauth + name: Authenticate to Google Cloud + uses: google-github-actions/auth@v1 + with: + credentials_json: ${{ secrets.GCLOUD_AUTH }} - name: Setup gcloud CLI uses: google-github-actions/setup-gcloud@v2 From bb33d2b8f4be2a633bf27655a16d28f5aa1947b1 Mon Sep 17 00:00:00 2001 From: faucomte97 Date: Wed, 20 Dec 2023 14:44:07 +0000 Subject: [PATCH 3/8] Test removing args for new action version --- .github/workflows/deploy_dev.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/deploy_dev.yml b/.github/workflows/deploy_dev.yml index 370baa1..3f315c9 100644 --- a/.github/workflows/deploy_dev.yml +++ b/.github/workflows/deploy_dev.yml @@ -41,15 +41,12 @@ jobs: - id: gcauth name: Authenticate to Google Cloud - uses: google-github-actions/auth@v1 + uses: google-github-actions/auth@v2 with: credentials_json: ${{ secrets.GCLOUD_AUTH }} - name: Setup gcloud CLI uses: google-github-actions/setup-gcloud@v2 - with: - version: "337.0.0" - project_id: ${{ env.APP_ID }} - name: Deploy to Google Cloud uses: ./.github/actions/deploy_gcloud From 095b9ef5ddc6606c74f6a66c6462d5d2729bc4c8 Mon Sep 17 00:00:00 2001 From: faucomte97 Date: Wed, 20 Dec 2023 14:52:20 +0000 Subject: [PATCH 4/8] Install new gke auth plugin --- .github/actions/deploy_gcloud/action.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/actions/deploy_gcloud/action.yml b/.github/actions/deploy_gcloud/action.yml index 1935285..3cb9b41 100644 --- a/.github/actions/deploy_gcloud/action.yml +++ b/.github/actions/deploy_gcloud/action.yml @@ -169,7 +169,8 @@ runs: shell: bash - name: "Get cluster credentials" - run: |- + run: | + sudo apt-get install google-cloud-sdk-gke-gcloud-auth-plugin gcloud container clusters get-credentials "aimmo-$MODULE_NAME" --zone "$GKE_ZONE" env: MODULE_NAME: ${{ inputs.module-name }} From a907cda5e29d2e9c738e57408c7de11798b576af Mon Sep 17 00:00:00 2001 From: faucomte97 Date: Wed, 20 Dec 2023 15:02:02 +0000 Subject: [PATCH 5/8] Try GKE auth action --- .github/actions/deploy_gcloud/action.yml | 3 +-- .github/workflows/deploy_dev.yml | 8 ++++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/actions/deploy_gcloud/action.yml b/.github/actions/deploy_gcloud/action.yml index 3cb9b41..1935285 100644 --- a/.github/actions/deploy_gcloud/action.yml +++ b/.github/actions/deploy_gcloud/action.yml @@ -169,8 +169,7 @@ runs: shell: bash - name: "Get cluster credentials" - run: | - sudo apt-get install google-cloud-sdk-gke-gcloud-auth-plugin + run: |- gcloud container clusters get-credentials "aimmo-$MODULE_NAME" --zone "$GKE_ZONE" env: MODULE_NAME: ${{ inputs.module-name }} diff --git a/.github/workflows/deploy_dev.yml b/.github/workflows/deploy_dev.yml index 3f315c9..38bc1ed 100644 --- a/.github/workflows/deploy_dev.yml +++ b/.github/workflows/deploy_dev.yml @@ -48,6 +48,14 @@ jobs: - name: Setup gcloud CLI uses: google-github-actions/setup-gcloud@v2 + - name: GKE auth + uses: simenandre/setup-gke-gcloud-auth-plugin@v1 + + - uses: google-github-actions/get-gke-credentials@v2 + with: + cluster_name: aimmo-dev + location: europe-west1-b + - name: Deploy to Google Cloud uses: ./.github/actions/deploy_gcloud with: From 39c5d757730d128617abc87733d17a421c20cc25 Mon Sep 17 00:00:00 2001 From: faucomte97 Date: Wed, 20 Dec 2023 15:05:05 +0000 Subject: [PATCH 6/8] Try not getting creds --- .github/workflows/deploy_dev.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/deploy_dev.yml b/.github/workflows/deploy_dev.yml index 38bc1ed..f5950b6 100644 --- a/.github/workflows/deploy_dev.yml +++ b/.github/workflows/deploy_dev.yml @@ -51,10 +51,10 @@ jobs: - name: GKE auth uses: simenandre/setup-gke-gcloud-auth-plugin@v1 - - uses: google-github-actions/get-gke-credentials@v2 - with: - cluster_name: aimmo-dev - location: europe-west1-b +# - uses: google-github-actions/get-gke-credentials@v2 +# with: +# cluster_name: aimmo-dev +# location: europe-west1-b - name: Deploy to Google Cloud uses: ./.github/actions/deploy_gcloud From 2d1edccb38968069e85234d7b3a8e29a2d82a24a Mon Sep 17 00:00:00 2001 From: faucomte97 Date: Wed, 20 Dec 2023 15:08:45 +0000 Subject: [PATCH 7/8] Clean up --- .github/workflows/deploy_dev.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/deploy_dev.yml b/.github/workflows/deploy_dev.yml index f5950b6..6c9c5d9 100644 --- a/.github/workflows/deploy_dev.yml +++ b/.github/workflows/deploy_dev.yml @@ -51,11 +51,6 @@ jobs: - name: GKE auth uses: simenandre/setup-gke-gcloud-auth-plugin@v1 -# - uses: google-github-actions/get-gke-credentials@v2 -# with: -# cluster_name: aimmo-dev -# location: europe-west1-b - - name: Deploy to Google Cloud uses: ./.github/actions/deploy_gcloud with: From 841718143a835e953a36f20d825e66a8126c6117 Mon Sep 17 00:00:00 2001 From: faucomte97 Date: Wed, 20 Dec 2023 15:14:00 +0000 Subject: [PATCH 8/8] Changes for other envs too --- .github/workflows/deploy_default.yml | 6 +++--- .github/workflows/deploy_staging.yml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/deploy_default.yml b/.github/workflows/deploy_default.yml index 734a020..682e933 100644 --- a/.github/workflows/deploy_default.yml +++ b/.github/workflows/deploy_default.yml @@ -33,9 +33,9 @@ jobs: - name: Setup gcloud CLI uses: google-github-actions/setup-gcloud@v2 - with: - version: "337.0.0" - project_id: ${{ env.APP_ID }} + + - name: GKE auth + uses: simenandre/setup-gke-gcloud-auth-plugin@v1 - name: Deploy to Google Cloud uses: ./.github/actions/deploy_gcloud diff --git a/.github/workflows/deploy_staging.yml b/.github/workflows/deploy_staging.yml index f416096..39ea37c 100644 --- a/.github/workflows/deploy_staging.yml +++ b/.github/workflows/deploy_staging.yml @@ -33,9 +33,9 @@ jobs: - name: Setup gcloud CLI uses: google-github-actions/setup-gcloud@v2 - with: - version: "337.0.0" - project_id: ${{ env.APP_ID }} + + - name: GKE auth + uses: simenandre/setup-gke-gcloud-auth-plugin@v1 - name: Deploy to Google Cloud uses: ./.github/actions/deploy_gcloud