Skip to content

Commit 21d3c9e

Browse files
✨ fix : CI/CD 원래대로 복원 - 1분 30초 정도로 가장 빠름
1 parent 61802a6 commit 21d3c9e

File tree

2 files changed

+3
-29
lines changed

2 files changed

+3
-29
lines changed

.github/workflows/ci-cd-main.yml

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -10,70 +10,49 @@ jobs:
1010
runs-on: ubuntu-latest
1111

1212
steps:
13-
# 1. Checkout code
1413
- name: Checkout code
1514
uses: actions/checkout@v3 # 최신 버전 사용
1615

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
2716
- name: Set up Docker Buildx
2817
uses: docker/setup-buildx-action@v2 # 최신 버전 사용
2918

30-
# 4. Cache Docker layers
3119
- name: Cache Docker layers
32-
uses: actions/cache@v3
20+
uses: actions/cache@v3 # 최신 버전 사용
3321
with:
3422
path: /tmp/.buildx-cache
3523
key: ${{ runner.os }}-buildx-${{ github.sha }}
3624
restore-keys: |
3725
${{ runner.os }}-buildx-
3826
39-
# 5. Log in to Google Cloud
4027
- name: Log in to Google Cloud
41-
uses: google-github-actions/auth@v1
28+
uses: google-github-actions/auth@v1 # 최신 버전 사용
4229
with:
4330
credentials_json: ${{ secrets.GCP_CREDENTIALS }}
4431

45-
# 6. Configure docker for gcloud
4632
- name: Configure docker for gcloud
4733
run: gcloud auth configure-docker asia-northeast3-docker.pkg.dev
4834

49-
# 7. Build and push Docker image
5035
- name: Build and push Docker image
5136
run: |
5237
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 \
5638
--tag asia-northeast3-docker.pkg.dev/symbolic-yen-441710-h6/practice-main/kafka-user:${{ github.sha }} .
5739
5840
deploy:
5941
runs-on: ubuntu-latest
6042
needs: build
6143

6244
steps:
63-
# 1. Checkout deployment repo
6445
- name: Checkout deployment repo
65-
uses: actions/checkout@v3
46+
uses: actions/checkout@v3 # 최신 버전 사용
6647
with:
6748
repository: kafka-practice/kafka-manifest
6849
path: manifests
6950
token: ${{ secrets.DEPLOY_KEY }}
7051

71-
# 2. Update manifest
7252
- name: Update manifest
7353
run: |
7454
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
7555
76-
# 3. Commit and push changes
7756
- name: Commit and push changes
7857
working-directory: manifests
7958
run: |

Dockerfile

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,12 @@
11
# builder image
2-
# Gradle 캐시를 활용한 Dockerfile
32
FROM amazoncorretto:17-al2-jdk AS builder
43

5-
# 작업 디렉토리 생성
64
RUN mkdir /kafka-user
75
WORKDIR /kafka-user
86

9-
RUN mkdir -p /home/gradle/.gradle
10-
117
COPY . .
128

139
RUN chmod +x gradlew
14-
RUN ./gradlew dependencies
1510
RUN ./gradlew clean bootJar
1611

1712
# runtime image

0 commit comments

Comments
 (0)