-
Notifications
You must be signed in to change notification settings - Fork 1
64 lines (56 loc) · 1.82 KB
/
BuildLocationServer.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
56
57
58
59
60
61
62
63
64
name: Build Location Server
on:
push:
tags:
- Location-v*.*.*
jobs:
build:
runs-on: ubuntu-latest
env:
image: deploy-test
tag: latest
strategy:
#모듈들 명
matrix:
kotlin-version: [ 1.5.31 ]
java-version: [ 11 ]
outputs:
#버전
VERSION: ${{ steps.get_version.outputs.VERSION }}
steps:
- name: Check Out The Repository
uses: actions/checkout@v3
- name: Set up Kotlin
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java-version }}
kotlin-version: ${{ matrix.kotlin-version }}
distribution: 'adopt'
# branch tags -> version (without v)
- 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 # test 돌릴때 레디스 필요
run: docker-compose up -d
- name: Gradle Build
uses: gradle/gradle-build-action@v2
- name: Execute Gradle build
run: ./gradlew build :Whatnow-Api:build --no-daemon
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to NCP Registry
uses: docker/login-action@v2
with:
registry: ${{ secrets.NCP_CONTAINER_REGISTRY }}
username: ${{ secrets.NCP_ACCESS_KEY }}
password: ${{ secrets.NCP_SECRET_KEY }}
# docker build / push to NCP Container Registry
- name: Build and push
uses: docker/build-push-action@v3
with:
context: ./Whatnow-Location
# image push 최적화
push: true
tags: ${{secrets.NCP_CONTAINER_REGISTRY}}/whatnow-location:${{steps.get_version.outputs.VERSION }}