6
6
- master
7
7
release :
8
8
types :
9
- - published
9
+ - published
10
10
11
11
# Environment variables.
12
12
# ${{ secrets }} are taken from GitHub -> Settings -> Secrets
26
26
jobs :
27
27
gcloud-setup-and-build-and-publish-to-GCR :
28
28
name : Setup gcloud utility, Build DC-ANALYTICS image and Publish it to Container Registry
29
- runs-on : ubuntu-18 .04
29
+ runs-on : ubuntu-20 .04
30
30
steps :
31
31
- name : Checkout
32
- uses : actions/checkout@v2
32
+ uses : actions/checkout@v3
33
+
34
+ - name : Google Authentication
35
+ uses :
google-github-actions/[email protected]
36
+ with :
37
+ credentials_json : ${{ secrets.SERVICE_ACCOUNT_KEY }}
33
38
34
39
- name : Setup gcloud cli
35
- uses : google-github-actions/setup-gcloud@v0.2 .0
40
+ uses : google-github-actions/setup-gcloud@v0.6 .0
36
41
with :
37
- version : ' 320.0.0'
38
- service_account_key : ${{ secrets.SERVICE_ACCOUNT_KEY }}
42
+ version : ' 391.0.0'
39
43
40
44
- name : Configure docker to use the gcloud as a credential helper
41
45
run : |
42
- gcloud auth configure-docker
46
+ gcloud --quiet auth configure-docker
43
47
44
48
- name : Build DC-ANALYTICS image
49
+ working-directory : iris
45
50
run : |
46
51
docker build -t ${GCR_LOCATION}/${PROJECT_ID}/${IMAGE_NAME}:${GITHUB_SHA} .
47
52
48
53
- name : Publish DC-ANALYTICS image to Google Container Registry
54
+ working-directory : iris
49
55
run : |
50
56
docker push ${GCR_LOCATION}/${PROJECT_ID}/${IMAGE_NAME}:${GITHUB_SHA}
51
57
52
- gke-provisioner :
53
- # Inspired by:
54
- # # https://www.terraform.io/docs/github-actions/getting-started.html
55
- # # https://github.com/hashicorp/terraform-github-actions
56
- name : Provision GKE cluster
57
- runs-on : ubuntu-18 .04
58
- steps :
59
- - name : Checkout
60
- uses : actions/checkout@v2
61
-
62
- - name : Terraform init
63
- uses : hashicorp/terraform-github-actions@master
64
- with :
65
- tf_actions_version : 0.12.17
66
- tf_actions_subcommand : ' init'
67
- tf_actions_working_dir : ' terraform'
68
-
69
- - name : Terraform validate
70
- uses : hashicorp/terraform-github-actions@master
71
- with :
72
- tf_actions_version : 0.12.17
73
- tf_actions_subcommand : ' validate'
74
- tf_actions_working_dir : ' terraform'
75
-
76
- - name : Terraform plan
77
- uses : hashicorp/terraform-github-actions@master
78
- with :
79
- tf_actions_version : 0.12.17
80
- tf_actions_subcommand : ' plan'
81
- tf_actions_working_dir : ' terraform'
82
-
83
- - name : Terraform apply
84
- uses : hashicorp/terraform-github-actions@master
85
- with :
86
- tf_actions_version : 0.12.17
87
- tf_actions_subcommand : ' apply'
88
- tf_actions_working_dir : ' terraform'
58
+ # gke-provisioner:
59
+ # # Inspired by:
60
+ # ## https://www.terraform.io/docs/github-actions/getting-started.html
61
+ # ## https://github.com/hashicorp/terraform-github-actions
62
+ # name: Provision GKE cluster
63
+ # runs-on: ubuntu-20 .04
64
+ # steps:
65
+ # - name: Checkout
66
+ # uses: actions/checkout@v3
67
+
68
+ # - name: Terraform init
69
+ # uses: hashicorp/terraform-github-actions@master
70
+ # with:
71
+ # tf_actions_version: 0.12.17
72
+ # tf_actions_subcommand: 'init'
73
+ # tf_actions_working_dir: 'terraform'
74
+
75
+ # - name: Terraform validate
76
+ # uses: hashicorp/terraform-github-actions@master
77
+ # with:
78
+ # tf_actions_version: 0.12.17
79
+ # tf_actions_subcommand: 'validate'
80
+ # tf_actions_working_dir: 'terraform'
81
+
82
+ # - name: Terraform plan
83
+ # uses: hashicorp/terraform-github-actions@master
84
+ # with:
85
+ # tf_actions_version: 0.12.17
86
+ # tf_actions_subcommand: 'plan'
87
+ # tf_actions_working_dir: 'terraform'
88
+
89
+ # - name: Terraform apply
90
+ # uses: hashicorp/terraform-github-actions@master
91
+ # with:
92
+ # tf_actions_version: 0.12.17
93
+ # tf_actions_subcommand: 'apply'
94
+ # tf_actions_working_dir: 'terraform'
89
95
90
96
kubernetes-deploy :
91
97
name : Deploy Kubernetes manifests to GKE cluster
92
98
needs :
93
99
- gcloud-setup-and-build-and-publish-to-GCR
94
- - gke-provisioner
95
- runs-on : ubuntu-18 .04
100
+ # - gke-provisioner
101
+ runs-on : ubuntu-20 .04
96
102
steps :
97
103
- name : Checkout
98
- uses : actions/checkout@v2
104
+ uses : actions/checkout@v3
99
105
100
106
- name : Replace placeholders with values in statefulset template
101
107
working-directory : ./k8s/
@@ -105,15 +111,21 @@ jobs:
105
111
sed "s|DOCKER_IMAGE_TAG|${GITHUB_SHA}|" > statefulset.yaml
106
112
cat statefulset.yaml
107
113
114
+ - name : Google Authentication
115
+ uses :
google-github-actions/[email protected]
116
+ with :
117
+ credentials_json : ${{ secrets.SERVICE_ACCOUNT_KEY }}
118
+
108
119
- name : Setup gcloud cli
109
- uses : google-github-actions/setup-gcloud@v0.2 .0
120
+ uses : google-github-actions/setup-gcloud@v0.6 .0
110
121
with :
111
- version : ' 320.0.0'
112
- service_account_key : ${{ secrets.SERVICE_ACCOUNT_KEY }}
122
+ version : ' 391.0.0'
113
123
114
124
- name : Apply Kubernetes manifests
115
125
working-directory : ./k8s/
116
126
run : |
127
+ gcloud components install gke-gcloud-auth-plugin
128
+ export USE_GKE_GCLOUD_AUTH_PLUGIN=True
117
129
gcloud container clusters get-credentials ${GKE_CLUSTER} --zone ${GKE_ZONE} --project ${PROJECT_ID}
118
130
kubectl apply -f namespace.yaml
119
131
kubectl apply -f managed-certificate.yaml
0 commit comments