Deploy to GKE #23
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy to GKE | |
on: | |
workflow_call: | |
inputs: | |
tag: | |
required: true | |
type: string | |
secrets: | |
GKE_PROJECT: | |
required: true | |
GKE_CLUSTER: | |
required: true | |
GKE_ZONE: | |
required: true | |
GKE_SA_KEY: | |
required: true | |
workflow_dispatch: | |
inputs: | |
tag: | |
description: 'Image tag to deploy' | |
required: true | |
env: | |
PROJECT_ID: ${{ secrets.GKE_PROJECT }} | |
GKE_CLUSTER: ${{ secrets.GKE_CLUSTER }} | |
GKE_ZONE: ${{ secrets.GKE_ZONE }} | |
GKE_REGISTRY: gcr.io/${{ secrets.GKE_PROJECT }} | |
WIP: 'projects/399309401465/locations/global/workloadIdentityPools/github-pool/providers/github-provider' | |
SA: 'github-actions@${{ secrets.GKE_PROJECT }}.iam.gserviceaccount.com' | |
jobs: | |
deploy: | |
name: Deploy existing images | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: 'write' | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- id: 'auth' | |
uses: 'google-github-actions/auth@v1' | |
with: | |
workload_identity_provider: ${{ env.WIP }} | |
service_account: ${{ env.SA }} | |
- name: Fetch GKE credentials | |
uses: google-github-actions/get-gke-credentials@v1 | |
with: | |
cluster_name: ${{ env.GKE_CLUSTER }} | |
location: ${{ env.GKE_ZONE }} | |
- name: Deploy dima services on GKE | |
env: | |
GKE_REGISTRY: ${{ env.GKE_REGISTRY }} | |
IMAGE_TAG: ${{ inputs.tag }} | |
working-directory: stack/kubernetes | |
run: ./30_deploy_dima.sh ${IMAGE_TAG} |