-
Notifications
You must be signed in to change notification settings - Fork 1
69 lines (57 loc) · 2.8 KB
/
CI_main_push.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
65
66
67
68
69
name: Spring Boot & Gradle CI Jobs (With. main branches push)
on:
push:
branches: [ main ]
jobs:
build:
# 실행 환경 (Git Runners 개인 서버)
runs-on: self-hosted
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'adopt'
# application.yml 파일 설정
- name: resources 폴더 생성
run: |
mkdir -p ./heachi-core/auth-api/src/main/resources
mkdir -p ./heachi-core/housework-api/src/main/resources
mkdir -p ./heachi-domain-mongo/src/main/resources
mkdir -p ./heachi-domain-mysql/src/main/resources
mkdir -p ./heachi-domain-redis/src/main/resources
mkdir -p ./heachi-notify/src/main/resources
mkdir -p ./heachi-support/common/src/main/resources
mkdir -p ./heachi-support/external-clients/src/main/resources
mkdir -p ./heachi-support/aws-s3/src/main/resources
- name: yml 파일 생성
run: |
echo "${{ secrets.HEACHICORE_AUTHAPI_APPLICATION }}" > ./heachi-core/auth-api/src/main/resources/application.yml
echo "${{ secrets.HEACHICORE_HOUSEWORKAPI_APPLICATION }}" > ./heachi-core/housework-api/src/main/resources/application.yml
echo "${{ secrets.HEACHIDOMAINMONGO_APPLICATION }}" > ./heachi-domain-mongo/src/main/resources/application.yml
echo "${{ secrets.HEACHIDOMAINMYSQL_DATABASE }}" > ./heachi-domain-mysql/src/main/resources/database.yml
echo "${{ secrets.HEACHIDOMAINREDIS_DATABASE }}" > ./heachi-domain-redis/src/main/resources/redis.yml
echo "${{ secrets.HEACHINOTIFY_APPLICATION }}" > ./heachi-notify/src/main/resources/application.yml
echo "${{ secrets.HEACHISUPPORT_COMMON_COMMON }}" > ./heachi-support/common/src/main/resources/common.yml
echo "${{ secrets.HEACHISUPPORT_EXTERNALCLIENTS_APPLICATION }}" > ./heachi-support/external-clients/src/main/resources/application.yml
echo "${{ secrets.HEACHISUPPORT_AWS_S3 }}" > ./heachi-support/aws-s3/src/main/resources/s3.yml
# docker Build에 필요한 gradle.properties 설정
- name: gradle.properties 생성
run: echo "${{ secrets.GRADLE_PROPERTIES }}" > ./gradle.properties
# gradlew를 실행시키기 위해 권한 부여
- name: Gradlew에게 실행권한 부여
run: chmod +x gradlew
# 멀티모듈 빌드하기
- name: 멀티모듈 전체 빌드
run: ./gradlew build
# Jib을 이용한 도커 이미지 빌드 후 허브 푸쉬
- name: 도커 이미지 빌드 & 도커 허브 푸쉬
run: ./gradlew jib
deployment:
name: docker 배포
needs: build # depends on
runs-on: self-hosted
steps:
- name: docker-compose 배포 스크립트
run: ${{ secrets.DOCKER_COMPOSE_DEPLOYMENT_SCRIPT }}