-
Notifications
You must be signed in to change notification settings - Fork 6
61 lines (53 loc) · 1.51 KB
/
deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
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}