-
Notifications
You must be signed in to change notification settings - Fork 6
56 lines (46 loc) · 1.43 KB
/
BuildApiServer.yml
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
name: Build Api Server
on:
push:
tags:
- Api-v*.*.*
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
java-version: [ 17 ]
outputs:
version: ${{ steps.get_version.outputs.BRANCH_NAME }}
steps:
- name: Check Out The Repository
uses: actions/checkout@v3
- name: Set up Java
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java-version }}
distribution: 'corretto'
- name: Get the version
id: get_version
run: |
RELEASE_VERSION_WITHOUT_V="$(cut -d'v' -f2 <<< ${GITHUB_REF#refs/*/})"
echo ::set-output name=VERSION::$RELEASE_VERSION_WITHOUT_V
#테스트 수행용 도커 컴포즈
- name: Start containers
run: docker-compose up -d
- name: Gradle Build
uses: gradle/gradle-build-action@v2
- name: Execute Gradle build
run: ./gradlew :DuDoong-Api:build --no-daemon
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v3
with:
context: ./DuDoong-Api
push: true
tags: water0641/dudoong-api:${{ steps.get_version.outputs.VERSION }}