File tree 13 files changed +320
-300
lines changed
kotlin/co/bearus/magcloud/service/diary
13 files changed +320
-300
lines changed Original file line number Diff line number Diff line change
1
+ name : ArgoCD로 배포하기
2
+ on :
3
+ workflow_call :
4
+ inputs :
5
+ argocd-repo-name : # 'CChuYong/bsc-argocd-manifest'
6
+ required : true
7
+ type : string
8
+ overlay-name :
9
+ required : true
10
+ type : string
11
+ service-name :
12
+ required : true
13
+ type : string
14
+ image-name :
15
+ required : true
16
+ type : string
17
+ environment :
18
+ required : true
19
+ type : string
20
+ release-tag :
21
+ required : true
22
+ type : string
23
+ secrets :
24
+ AWS_ECR_REGISTRY_URL :
25
+ required : true
26
+ PAT_TOKEN :
27
+ required : true
28
+
29
+ jobs :
30
+ build :
31
+ runs-on : [ ubuntu-latest ]
32
+ name : ArgoCD로 배포하기
33
+
34
+ environment : ${{ inputs.environment }}
35
+
36
+ steps :
37
+ - name : GitHub 에서 레포 받아오기
38
+ uses : actions/checkout@v3
39
+ with :
40
+ repository : ${{ inputs.argocd-repo-name }}
41
+ token : ${{ secrets.PAT_TOKEN }}
42
+
43
+ - name : Kustomize 설정하기
44
+ uses : imranismail/setup-kustomize@v2
45
+
46
+ - name : 이미지 태그 변경 후 배포하기
47
+ run : |
48
+ cd ${{ inputs.service-name }}/overlays/${{ inputs.overlay-name }}
49
+ kustomize edit set image ${{ secrets.AWS_ECR_REGISTRY_URL }}/${{ inputs.image-name }}
50
+ cat kustomization.yaml
51
+ git config --local user.email "[email protected] "
52
+ git config --local user.name "GitHub Action"
53
+ git commit -am "release(${{ inputs.service-name }}): 자동배포 ${{ inputs.image-name }}"
54
+ git push -u origin main
55
+
56
+ - name : GitHub 에 릴리즈 태그 생성하기
57
+ uses : ncipollo/release-action@v1
58
+ with :
59
+ tag : ${{ inputs.service-name }}_${{ inputs.release-tag }}
60
+ name : ${{ inputs.image-name }}
61
+ body : " ${{ secrets.AWS_ECR_REGISTRY_URL }}/${{ inputs.image-name }}"
62
+ commit : ${{ github.sha }}
Original file line number Diff line number Diff line change
1
+ name : 이미지 빌드 & 푸쉬
2
+ on :
3
+ workflow_call :
4
+ inputs :
5
+ java-module-name :
6
+ required : true
7
+ type : string
8
+ ecr-repository-name :
9
+ required : true
10
+ type : string
11
+ environment :
12
+ required : true
13
+ type : string
14
+ image-tag :
15
+ required : true
16
+ type : string
17
+ spring-profile :
18
+ required : true
19
+ type : string
20
+ local :
21
+ required : false
22
+ type : boolean
23
+ default : false
24
+ secrets :
25
+ AWS_ASSUME_ROLE_ARN :
26
+ required : true
27
+ AWS_ECR_REGISTRY_URL :
28
+ required : true
29
+ AWS_REGION :
30
+ required : true
31
+
32
+ jobs :
33
+ build :
34
+ runs-on : [ ubuntu-latest ]
35
+ name : 이미지 빌드하기
36
+
37
+ permissions :
38
+ id-token : write
39
+ contents : read
40
+
41
+ steps :
42
+ - name : GitHub 에서 레포 받아오기
43
+ uses : actions/checkout@v3
44
+
45
+ - name : AWS 인증정보 준비하기
46
+ if : inputs.local == false
47
+ uses : aws-actions/configure-aws-credentials@v2
48
+ with :
49
+ role-to-assume : ${{ secrets.AWS_ASSUME_ROLE_ARN }}
50
+ aws-region : ${{ secrets.AWS_REGION }}
51
+
52
+ - name : AWS ECR 로그인하기
53
+ if : inputs.local == false
54
+ id : login-ecr
55
+ uses : aws-actions/amazon-ecr-login@v1
56
+
57
+ - name : JDK17 준비하기
58
+ uses : actions/setup-java@v3
59
+ with :
60
+ java-version : ' 17'
61
+ distribution : ' temurin'
62
+
63
+ - name : Gradle 준비하기
64
+ uses : gradle/gradle-build-action@v2
65
+
66
+ - name : 이미지 빌드하고 푸쉬하기
67
+ id : build-image
68
+ env :
69
+ IMAGE_TAG : ${{ needs.prepare.outputs.imageTag }}
70
+ ECR_REGISTRY_PREFIX : ' ${{ secrets.AWS_ECR_REGISTRY_URL }}/'
71
+ run : |
72
+ /bin/bash build.sh \
73
+ ${{ inputs.java-module-name }} \
74
+ ${{ env.ECR_REGISTRY_PREFIX }}${{ inputs.ecr-repository-name }} \
75
+ ${{ inputs.image-tag }} \
76
+ ${{ inputs.spring-profile }}
Load Diff This file was deleted.
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments