Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup Workload Identity Federation #323

Merged
merged 14 commits into from
Jun 27, 2024
3 changes: 2 additions & 1 deletion .github/actions/deploy_gcloud/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,8 @@ runs:
shell: bash

- name: "Get cluster credentials"
run: |-
run: |
gcloud components install gke-gcloud-auth-plugin
gcloud container clusters get-credentials "aimmo-$MODULE_NAME" --zone "$GKE_ZONE"
env:
MODULE_NAME: ${{ inputs.module-name }}
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/deploy_default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ jobs:
MODULE_NAME: default
VERSION: ${{ github.run_number }}
DATABASE_POSTFIX: ${{ secrets.DATABASE_POSTFIX }}
permissions:
id-token: 'write'
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -25,18 +27,17 @@ jobs:
python-version: "3.8.x"
architecture: "x64"

- id: gcauth
- id: auth
name: Authenticate to Google Cloud
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.GCLOUD_AUTH }}
project_id: 'decent-digit-629'
workload_identity_provider: 'projects/354656325390/locations/global/workloadIdentityPools/cfl-pool/providers/cfl-provider'
service_account: '[email protected]'

- name: Setup gcloud CLI
uses: google-github-actions/setup-gcloud@v2

- name: GKE auth
uses: simenandre/setup-gke-gcloud-auth-plugin@v1

- name: Deploy to Google Cloud
uses: ./.github/actions/deploy_gcloud
with:
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/deploy_dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ jobs:
MODULE_NAME: dev
VERSION: ${{ github.run_number }}
DATABASE_POSTFIX: ${{ secrets.DATABASE_POSTFIX }}
permissions:
id-token: 'write'
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -39,18 +41,17 @@ jobs:
python-version: "3.8.x"
architecture: "x64"

- id: gcauth
- id: auth
name: Authenticate to Google Cloud
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.GCLOUD_AUTH }}
project_id: 'decent-digit-629'
workload_identity_provider: 'projects/354656325390/locations/global/workloadIdentityPools/cfl-pool/providers/cfl-provider'
service_account: '[email protected]'

- name: Setup gcloud CLI
uses: google-github-actions/setup-gcloud@v2

- name: GKE auth
uses: simenandre/setup-gke-gcloud-auth-plugin@v1

- name: Deploy to Google Cloud
uses: ./.github/actions/deploy_gcloud
with:
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/deploy_staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ jobs:
MODULE_NAME: staging
VERSION: ${{ github.run_number }}
DATABASE_POSTFIX: ${{ secrets.DATABASE_POSTFIX }}
permissions:
id-token: 'write'
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -25,18 +27,17 @@ jobs:
python-version: "3.8.x"
architecture: "x64"

- id: gcauth
- id: auth
name: Authenticate to Google Cloud
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.GCLOUD_AUTH }}
project_id: 'decent-digit-629'
workload_identity_provider: 'projects/354656325390/locations/global/workloadIdentityPools/cfl-pool/providers/cfl-provider'
service_account: '[email protected]'

- name: Setup gcloud CLI
uses: google-github-actions/setup-gcloud@v2

- name: GKE auth
uses: simenandre/setup-gke-gcloud-auth-plugin@v1

- name: Deploy to Google Cloud
uses: ./.github/actions/deploy_gcloud
with:
Expand Down