@@ -10,70 +10,49 @@ jobs:
10
10
runs-on : ubuntu-latest
11
11
12
12
steps :
13
- # 1. Checkout code
14
13
- name : Checkout code
15
14
uses : actions/checkout@v3 # 최신 버전 사용
16
15
17
- # 2. Cache Gradle dependencies
18
- - name : Cache Gradle dependencies
19
- uses : actions/cache@v4
20
- with :
21
- path : ~/.gradle/caches
22
- key : ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradlew') }}
23
- restore-keys : |
24
- ${{ runner.os }}-gradle-
25
-
26
- # 3. Set up Docker Buildx
27
16
- name : Set up Docker Buildx
28
17
uses : docker/setup-buildx-action@v2 # 최신 버전 사용
29
18
30
- # 4. Cache Docker layers
31
19
- name : Cache Docker layers
32
- uses : actions/cache@v3
20
+ uses : actions/cache@v3 # 최신 버전 사용
33
21
with :
34
22
path : /tmp/.buildx-cache
35
23
key : ${{ runner.os }}-buildx-${{ github.sha }}
36
24
restore-keys : |
37
25
${{ runner.os }}-buildx-
38
26
39
- # 5. Log in to Google Cloud
40
27
- name : Log in to Google Cloud
41
- uses : google-github-actions/auth@v1
28
+ uses : google-github-actions/auth@v1 # 최신 버전 사용
42
29
with :
43
30
credentials_json : ${{ secrets.GCP_CREDENTIALS }}
44
31
45
- # 6. Configure docker for gcloud
46
32
- name : Configure docker for gcloud
47
33
run : gcloud auth configure-docker asia-northeast3-docker.pkg.dev
48
34
49
- # 7. Build and push Docker image
50
35
- name : Build and push Docker image
51
36
run : |
52
37
docker buildx build --push \
53
- --cache-from=type=local,src=/tmp/.buildx-cache \
54
- --cache-to=type=local,dest=/tmp/.buildx-cache \
55
- --build-arg GRADLE_USER_HOME=/home/gradle/.gradle \
56
38
--tag asia-northeast3-docker.pkg.dev/symbolic-yen-441710-h6/practice-main/kafka-user:${{ github.sha }} .
57
39
58
40
deploy :
59
41
runs-on : ubuntu-latest
60
42
needs : build
61
43
62
44
steps :
63
- # 1. Checkout deployment repo
64
45
- name : Checkout deployment repo
65
- uses : actions/checkout@v3
46
+ uses : actions/checkout@v3 # 최신 버전 사용
66
47
with :
67
48
repository : kafka-practice/kafka-manifest
68
49
path : manifests
69
50
token : ${{ secrets.DEPLOY_KEY }}
70
51
71
- # 2. Update manifest
72
52
- name : Update manifest
73
53
run : |
74
54
sed -i "s|image: .*|image: asia-northeast3-docker.pkg.dev/symbolic-yen-441710-h6/practice-main/kafka-user:${{ github.sha }}|" manifests/kafka-user/deployment.yaml
75
55
76
- # 3. Commit and push changes
77
56
- name : Commit and push changes
78
57
working-directory : manifests
79
58
run : |
0 commit comments