-
Notifications
You must be signed in to change notification settings - Fork 0
92 lines (77 loc) · 2.46 KB
/
dev-ci.yml
File metadata and controls
92 lines (77 loc) · 2.46 KB
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
name: Java CI & Docker Build
on:
push:
branches: [ "dev", "kakao" ]
pull_request:
branches: [ "dev", "kakao" ]
permissions:
contents: read
checks: write
pull-requests: write
packages: write
jobs:
build:
runs-on: ubuntu-latest
steps:
# 1) 소스 코드 + 서브모듈 체크아웃
- name: Checkout source & submodules
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
token: ${{ secrets.ACTION_TOKEN }}
# 2) gradlew 실행 권한 부여
- name: Grant execute permission to gradlew
run: chmod +x gradlew
# 3) JDK 21 설치
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
# 4) Gradle 캐싱 및 설정
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
# 5) 애플리케이션 빌드 (dev 프로파일)
- name: Build with Gradle
run: ./gradlew clean bootJar --no-daemon -Dspring.profiles.active=dev
# 6) 테스트 결과 리포트
- name: Publish Test Report
uses: mikepenz/action-junit-report@v5
if: success() || failure()
with:
report_paths: '**/build/test-results/test/TEST-*.xml'
# 7) QEMU (멀티아키 에뮬)
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
# 8) Buildx (멀티아키 빌더)
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3
with:
driver: docker-container
# 9) GHCR 로그인
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.ACTION_TOKEN }}
# 10) 이미지 메타데이터 (★ 전부 소문자 경로 + sha 짧은 형태)
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/lets-gu/backend
tags: |
type=sha,format=short
# 11) 멀티아키 빌드 & 푸시 (amd64 + arm64)
- name: Build and Push Docker image (multi-arch)
uses: docker/build-push-action@v6
with:
context: .
file: Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
platforms: linux/amd64,linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max