-
Notifications
You must be signed in to change notification settings - Fork 0
128 lines (110 loc) ยท 4.24 KB
/
deploy_msa_k8s.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
name: deploy inong with k8s
on:
push:
branches:
- develop
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: checkout github
uses: actions/checkout@v2
- name: install kubectl
uses: azure/setup-kubectl@v3
with:
version: "v1.25.9"
id: install
- name: configure aws
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{secrets.AWS_KEY}}
aws-secret-access-key: ${{secrets.AWS_SECRET}}
aws-region: ap-northeast-2
- name: update cluster information
run: aws eks update-kubeconfig --name inong-cluster --region ap-northeast-2
- name: login ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
- name: create-member-json
uses: jsdaniell/[email protected]
with:
name: "dongsanginong-24f95-firebase-adminsdk-1qp94-db073413ff.json"
json: ${{ secrets.FCM_CREDENTIALS }}
dir: './backend/member/src/main/resources'
- name: create-product-json
uses: jsdaniell/[email protected]
with:
name: "dongsanginong-24f95-firebase-adminsdk-1qp94-db073413ff.json"
json: ${{ secrets.FCM_CREDENTIALS }}
dir: './backend/product/src/main/resources'
# product
- name: build and push docker product images to ecr
env:
REGISTRY: 676206947506.dkr.ecr.ap-northeast-2.amazonaws.com
REPOSITORY: inong/product
run: |
docker build -t $REGISTRY/$REPOSITORY:latest \
-f ./backend/product/Dockerfile ./backend/product
docker push $REGISTRY/$REPOSITORY:latest
- name: eks kubectl apply
run: |
kubectl apply -f ./backend/product/k8s/product-depl.yml
kubectl rollout restart deployment product-deployment
# member
- name: build and push docker member images to ecr
env:
REGISTRY: 676206947506.dkr.ecr.ap-northeast-2.amazonaws.com
REPOSITORY: inong/member
run: |
docker build -t $REGISTRY/$REPOSITORY:latest \
-f ./backend/member/Dockerfile ./backend/member
docker push $REGISTRY/$REPOSITORY:latest
- name: eks kubectl apply
run: |
kubectl apply -f ./backend/member/k8s/member-depl.yml
kubectl rollout restart deployment member-deployment
# order
- name: build and push docker order images to ecr
env:
REGISTRY: 676206947506.dkr.ecr.ap-northeast-2.amazonaws.com
REPOSITORY: inong/order
run: |
docker build -t $REGISTRY/$REPOSITORY:latest \
-f ./backend/order/Dockerfile ./backend/order
docker push $REGISTRY/$REPOSITORY:latest
- name: eks kubectl apply
run: |
kubectl apply -f ./backend/order/k8s/order-depl.yml
kubectl rollout restart deployment order-deployment
# live
- name: build and push docker live images to ecr
env:
REGISTRY: 676206947506.dkr.ecr.ap-northeast-2.amazonaws.com
REPOSITORY: inong/live
run: |
docker build -t $REGISTRY/$REPOSITORY:latest \
-f ./backend/live/Dockerfile ./backend/live
docker push $REGISTRY/$REPOSITORY:latest
- name: eks kubectl apply
run: |
kubectl apply -f ./backend/live/k8s/live-depl.yml
kubectl rollout restart deployment live-deployment
# apigateway
- name: build and push docker apigateway images to ecr
env:
REGISTRY: 676206947506.dkr.ecr.ap-northeast-2.amazonaws.com
REPOSITORY: inong/apigateway
run: |
docker build -t $REGISTRY/$REPOSITORY:latest \
-f ./backend/apigateway/Dockerfile ./backend/apigateway
docker push $REGISTRY/$REPOSITORY:latest
- name: eks kubectl apply
run: |
kubectl apply -f ./backend/apigateway/k8s/apigateway-depl.yml
kubectl rollout restart deployment apigateway-deployment
# openvidu
- name: eks kubectl apply
run: |
kubectl apply -f ./k8s/openvidu-depl.yml
kubectl apply -f ./k8s/openvidu-service.yml
kubectl rollout restart deployment openvidu-deployment