-
Notifications
You must be signed in to change notification settings - Fork 1
63 lines (56 loc) · 1.5 KB
/
jib-build.yaml
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
name: 이미지 빌드 & 푸쉬
on:
workflow_call:
inputs:
spring-profile:
required: true
type: string
server-port:
required: true
type: string
image-name:
required: true
type: string
image-tag:
required: true
type: string
module-path:
required: true
type: string
secrets:
DOCKERHUB_USERNAME:
required: true
DOCKERHUB_TOKEN:
required: true
jobs:
build:
runs-on: [ ubuntu-latest ]
name: 이미지 빌드하기
permissions:
id-token: write
contents: read
steps:
- name: GitHub 에서 레포 받아오기
uses: actions/checkout@v3
- name: 도커허브 로그인
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: JDK17 준비하기
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Gradle 준비하기
uses: gradle/actions/setup-gradle@v3
- name: 이미지 빌드하고 푸쉬하기
id: build-image
env:
SPRING_PROFILES_ACTIVE: ${{ inputs.spring-profile }}
IMAGE_NAME: ${{ inputs.image-name }}
IMAGE_TAG: ${{ inputs.image-tag }}
SERVER_PORT: ${{ inputs.server-port }}
run: |
cd ${{ inputs.module-path }} && \
chmod +x gradlew && ./gradlew jib