66 - master
77 release :
88 types :
9- - published
9+ - published
1010
1111# Environment variables.
1212# ${{ secrets }} are taken from GitHub -> Settings -> Secrets
2626jobs :
2727 gcloud-setup-and-build-and-publish-to-GCR :
2828 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
3030 steps :
3131 - name : Checkout
32- uses : actions/checkout@v2
32+ uses : actions/checkout@v3
33+
34+ - name : Google Authentication
35+ uses : google-github-actions/auth@v0.8.0
36+ with :
37+ credentials_json : ${{ secrets.SERVICE_ACCOUNT_KEY }}
3338
3439 - name : Setup gcloud cli
35- uses : google-github-actions/setup-gcloud@v0.2 .0
40+ uses : google-github-actions/setup-gcloud@v0.6 .0
3641 with :
37- version : ' 320.0.0'
38- service_account_key : ${{ secrets.SERVICE_ACCOUNT_KEY }}
42+ version : ' 391.0.0'
3943
4044 - name : Configure docker to use the gcloud as a credential helper
4145 run : |
42- gcloud auth configure-docker
46+ gcloud --quiet auth configure-docker
4347
4448 - name : Build DC-ANALYTICS image
49+ working-directory : iris
4550 run : |
4651 docker build -t ${GCR_LOCATION}/${PROJECT_ID}/${IMAGE_NAME}:${GITHUB_SHA} .
4752
4853 - name : Publish DC-ANALYTICS image to Google Container Registry
54+ working-directory : iris
4955 run : |
5056 docker push ${GCR_LOCATION}/${PROJECT_ID}/${IMAGE_NAME}:${GITHUB_SHA}
5157
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'
8995
9096 kubernetes-deploy :
9197 name : Deploy Kubernetes manifests to GKE cluster
9298 needs :
9399 - 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
96102 steps :
97103 - name : Checkout
98- uses : actions/checkout@v2
104+ uses : actions/checkout@v3
99105
100106 - name : Replace placeholders with values in statefulset template
101107 working-directory : ./k8s/
@@ -105,15 +111,21 @@ jobs:
105111 sed "s|DOCKER_IMAGE_TAG|${GITHUB_SHA}|" > statefulset.yaml
106112 cat statefulset.yaml
107113
114+ - name : Google Authentication
115+ uses : google-github-actions/auth@v0.8.0
116+ with :
117+ credentials_json : ${{ secrets.SERVICE_ACCOUNT_KEY }}
118+
108119 - name : Setup gcloud cli
109- uses : google-github-actions/setup-gcloud@v0.2 .0
120+ uses : google-github-actions/setup-gcloud@v0.6 .0
110121 with :
111- version : ' 320.0.0'
112- service_account_key : ${{ secrets.SERVICE_ACCOUNT_KEY }}
122+ version : ' 391.0.0'
113123
114124 - name : Apply Kubernetes manifests
115125 working-directory : ./k8s/
116126 run : |
127+ gcloud components install gke-gcloud-auth-plugin
128+ export USE_GKE_GCLOUD_AUTH_PLUGIN=True
117129 gcloud container clusters get-credentials ${GKE_CLUSTER} --zone ${GKE_ZONE} --project ${PROJECT_ID}
118130 kubectl apply -f namespace.yaml
119131 kubectl apply -f managed-certificate.yaml
0 commit comments