File tree Expand file tree Collapse file tree 3 files changed +25
-11
lines changed Expand file tree Collapse file tree 3 files changed +25
-11
lines changed Original file line number Diff line number Diff line change 6
6
apply :
7
7
runs-on : ubuntu-latest
8
8
env :
9
- GOOGLE_CREDENTIALS : ${{ secrets.GOOGLE_CRED }}
9
+ GOOGLE_CREDENTIALS : ${{ secrets.CREDENTIALS }}
10
10
11
11
steps :
12
12
- name : Checkout Repo
15
15
- name : Auth GCloud
16
16
uses : ' google-github-actions/auth@v2.1.2'
17
17
with :
18
- credentials_json : ${{ secrets.GOOGLE_CRED }}
18
+ credentials_json : ${{ secrets.CREDENTIALS }}
19
19
export_environment_variables : true
20
20
create_credentials_file : true
21
21
@@ -28,11 +28,25 @@ jobs:
28
28
- name : Setup Cluster Kubernetes
29
29
uses : ' google-github-actions/get-gke-credentials@v2'
30
30
with :
31
- cluster_name : ${{ vars.CLUSTER }}
31
+ cluster_name : ${{ vars.CLUSTER_NAME }}
32
32
location : ${{ vars.ZONE }}
33
33
34
34
- name : Setup Namespace
35
35
run : kubectl config set-context --current --namespace=orderly
36
36
37
+ - name : Create ConfigMap
38
+ working-directory : k8s/
39
+ run : |
40
+ echo "$(cat api-configmap.yaml)" | envsubst | kubectl apply -f -
41
+ env :
42
+ DB_PASSWORD : ${{ secrets.DB_PASSWORD }}
43
+ DB_IP : ${{ vars.DB_IP }}
44
+ DB_USERNAME : ${{ vars.DB_USERNAME }}
45
+ DB_NAME : ${{ vars.DB_NAME }}
46
+
47
+
37
48
- name : apply api
38
- run : kubectl apply -f k8s/
49
+ run : |
50
+ kubectl apply -f k8s/api-deployment.yaml
51
+ kubectl apply -f k8s/api-hpa.yaml
52
+ kubectl apply -f k8s/api-service.yaml
Original file line number Diff line number Diff line change 6
6
destroy :
7
7
runs-on : ubuntu-latest
8
8
env :
9
- GOOGLE_CREDENTIALS : ${{ secrets.GOOGLE_CRED }}
9
+ GOOGLE_CREDENTIALS : ${{ secrets.CREDENTIALS }}
10
10
11
11
steps :
12
12
- name : Checkout Repo
15
15
- name : Auth GCloud
16
16
uses : ' google-github-actions/auth@v2.1.2'
17
17
with :
18
- credentials_json : ${{ secrets.GOOGLE_CRED }}
18
+ credentials_json : ${{ secrets.CREDENTIALS }}
19
19
export_environment_variables : true
20
20
create_credentials_file : true
21
21
25
25
- name : Setup Cluster Kubernetes
26
26
uses : ' google-github-actions/get-gke-credentials@v2'
27
27
with :
28
- cluster_name : ${{ vars.CLUSTER }}
28
+ cluster_name : ${{ vars.CLUSTER_NAME }}
29
29
location : ${{ vars.ZONE }}
30
30
31
31
- name : Setup Namespace
Original file line number Diff line number Diff line change @@ -5,11 +5,11 @@ metadata:
5
5
data :
6
6
PORT : " 3000"
7
7
NODE_ENV : " production"
8
- DB_HOST : " 34.31.179.110 " # db-service
9
- DB_USERNAME : " postgres-user " # "postgres"
8
+ DB_HOST : " ${DB_IP} " # db-service
9
+ DB_USERNAME : " ${DB_USERNAME} " # "postgres"
10
10
DB_PORT : " 5432"
11
- DB_PASSWORD : " postgres-pass " # "postgres"
12
- DB_NAME : " orderly-db " # postgres
11
+ DB_PASSWORD : " ${DB_PASSWORD} " # "postgres"
12
+ DB_NAME : " ${DB_NAME} " # postgres
13
13
DB_DIALECT : postgres
14
14
CACHE_HOST : cache-service
15
15
CACHE_PORT : " 6379"
You can’t perform that action at this time.
0 commit comments