-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/develop' into develop
- Loading branch information
Showing
2 changed files
with
105 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
name: Spring Boot & Gradle CICD Jobs (With. dev branches push) | ||
|
||
on: | ||
push: | ||
branches: [ develop ] | ||
paths: | ||
- 'src/**' | ||
|
||
jobs: | ||
build: | ||
# 실행 환경 (urdego 서버) | ||
runs-on: [self-hosted, urdego] | ||
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 ./src/main/resources | ||
# yml 파일 생성 | ||
- name: yml 파일 생성 | ||
run: | | ||
echo "${{ secrets.GAME_APPLICATION_DEFAULT }}" >> ./src/main/resources/application.yml | ||
echo "${{ secrets.GAME_APPLICATION_PROD }}" >> ./src/main/resources/application-prod.yml | ||
echo "${{ secrets.GAME_APPLICATION_DB }}" >> ./src/main/resources/database-prod.yml | ||
# gradlew 실행 권한 부여 | ||
- name: Gradlew 실행권한 부여 | ||
run: chmod +x ./gradlew | ||
|
||
- name: 빌드 (테스트 미포함) | ||
run: ./gradlew clean build -x test | ||
|
||
deploy: | ||
# Docker 배포 작업 | ||
name: docker deployment | ||
needs: build # deponeds on | ||
runs-on: [self-hosted, urdego] | ||
|
||
steps: | ||
- name: docker-compose 생성 | ||
run: | | ||
echo "${{ secrets.DOCKER_COMPOSE_GAME }}" >> ./docker-compose.yml | ||
# 도커 컨테이너 중지 및 이미지 제거 | ||
- name: 도커 컴포즈 다운 및 이미지 제거 | ||
run: | | ||
docker-compose down | ||
# 특정 이미지 제거 | ||
docker rmi $(docker images --format "{{.Repository}}:{{.Tag}}" | grep 'game_service:latest') || echo "No game_service image to remove" | ||
# 도커 컴포즈 실행 | ||
- name: 도커 컴포즈 실행 | ||
run: | | ||
docker-compose up -d | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Spring Boot & Gradle CI Jobs (With dev branches pull_request) | ||
|
||
on: | ||
pull_request: | ||
branches: [ develop ] | ||
paths: | ||
- 'src/**' | ||
|
||
jobs: | ||
build: | ||
# 실행 환경 | ||
runs-on: [self-hosted, urdego] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
# JDK 설정 | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '17' | ||
distribution: 'adopt' | ||
|
||
# resources 폴더 생성 | ||
- name: resources 폴더 생성 | ||
run: | | ||
mkdir -p ./src/main/resources | ||
# yml 파일 생성 | ||
- name: yml 파일 생성 | ||
run: | | ||
echo "${{ secrets.GAME_APPLICATION_DEFAULT }}" >> ./src/main/resources/application.yml | ||
echo "${{ secrets.GAME_APPLICATION_PROD }}" >> ./src/main/resources/application-prod.yml | ||
echo "${{ secrets.GAME_APPLICATION_DB }}" >> ./src/main/resources/database-prod.yml | ||
# gradlew 실행 권한 부여 | ||
- name: Gradlew 실행권한 부여 | ||
run: chmod +x ./gradlew | ||
|
||
# 빌드 | ||
- name: 빌드 | ||
run: ./gradlew clean build -x test |