-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[#47] feat: workflow 수정
- Loading branch information
Showing
2 changed files
with
66 additions
and
77 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 |
---|---|---|
@@ -1,11 +1,9 @@ | ||
name: deploy | ||
name: Java CI with Gradle & Deploy to EC2 | ||
|
||
# develop 브런치에 push가 되면 아래의 flow가 실행됩니다. | ||
on: | ||
workflow_run: | ||
workflows: [ "test" ] | ||
types: | ||
- completed | ||
push: | ||
branches: [ "develop" ] | ||
|
||
# flow에서 사용할 변수 | ||
env: | ||
|
@@ -44,6 +42,12 @@ jobs: | |
echo "${{ secrets.YML }}" | base64 --decode > src/main/resources/application.yml | ||
find src | ||
# 2.5) secret설정한 test-yml 등록 | ||
- name: Set TEST_YML | ||
run: | | ||
mkdir -p src/test/resources | ||
echo "${{ secrets.TEST_YML }}" | base64 --decode > src/test/resources/application-test.yml | ||
find src | ||
- name: Set up MariaDB 10 | ||
uses: getong/[email protected] | ||
|
@@ -55,30 +59,15 @@ jobs: | |
mysql password: ${{ secrets.DATABASE_KEY }} | ||
# mysql root password: ${{ secrets.RootPassword }} # Required if "mysql user" is empty, default is empty. The root superuser password | ||
|
||
# - name: Set TEST_YML | ||
# run: | | ||
# mkdir -p src/test/resources | ||
# echo "${{ secrets.TEST_YML }}" | base64 --decode > src/test/resources/application.yml | ||
# find src | ||
|
||
# - name: Set up MariaDB 10 for test | ||
# uses: getong/[email protected] | ||
# with: | ||
# host port: 3306 | ||
# container port: 3307 | ||
# mysql database: 'nanaland_test' | ||
# mysql user: 'root' | ||
# mysql password: ${{ secrets.DATABASE_KEY }} | ||
# # mysql root password: ${{ secrets.RootPassword }} # Required if "mysql user" is empty, default is empty. The root superuser password | ||
|
||
# 3) gradlew 권한 설정 | ||
- name: Grant execute permission for gradlew | ||
run: chmod +x gradlew | ||
# working-directory: ${{ env.working-directory }} | ||
# working-directory: ${{ env.working-directory }} | ||
|
||
# 4) gradle 빌드 | ||
- name: Build with Gradle | ||
run: ./gradlew clean build -x test -i | ||
run: ./gradlew clean build -i | ||
# run: ./gradlew clean build -i | ||
# working-directory: ${{ env.working-directory }} | ||
|
||
|
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 |
---|---|---|
@@ -1,55 +1,55 @@ | ||
name: test | ||
|
||
# develop 브런치에 push가 되면 아래의 flow가 실행됩니다. | ||
on: | ||
push: | ||
branches: [ "develop" ] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
deploy: | ||
name: test | ||
runs-on: ubuntu-latest | ||
environment: production | ||
|
||
# 아래의 flow들이 차례대로 실행됩니다. | ||
steps: | ||
# 1) 기본 체크아웃 | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
# 2) JDK 17 셋팅 | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
|
||
# 2.5) secret설정한 test-yml 등록 | ||
- name: Set TEST_YML | ||
run: | | ||
mkdir -p src/test/resources | ||
echo "${{ secrets.TEST_YML }}" | base64 --decode > src/test/resources/application-test.yml | ||
find src | ||
- name: Set up MariaDB 10 | ||
uses: getong/[email protected] | ||
with: | ||
host port: 3306 | ||
container port: 3306 | ||
mysql database: 'nanaland_test' | ||
mysql user: 'root' | ||
mysql password: ${{ secrets.DATABASE_KEY }} | ||
|
||
# 3) gradlew 권한 설정 | ||
- name: Grant execute permission for gradlew | ||
run: chmod +x gradlew | ||
# working-directory: ${{ env.working-directory }} | ||
|
||
# 4) gradle 빌드 | ||
- name: Build with Gradle | ||
run: ./gradlew clean test -i | ||
# run: ./gradlew clean build -i | ||
# working-directory: ${{ env.working-directory }} | ||
#name: test | ||
# | ||
## develop 브런치에 push가 되면 아래의 flow가 실행됩니다. | ||
#on: | ||
# push: | ||
# branches: [ "develop" ] | ||
# | ||
#permissions: | ||
# contents: read | ||
# | ||
#jobs: | ||
# deploy: | ||
# name: test | ||
# runs-on: ubuntu-latest | ||
# environment: production | ||
# | ||
# # 아래의 flow들이 차례대로 실행됩니다. | ||
# steps: | ||
# # 1) 기본 체크아웃 | ||
# - name: Checkout | ||
# uses: actions/checkout@v3 | ||
# | ||
# # 2) JDK 17 셋팅 | ||
# - name: Set up JDK 17 | ||
# uses: actions/setup-java@v3 | ||
# with: | ||
# java-version: '17' | ||
# distribution: 'temurin' | ||
# | ||
# # 2.5) secret설정한 test-yml 등록 | ||
# - name: Set TEST_YML | ||
# run: | | ||
# mkdir -p src/test/resources | ||
# echo "${{ secrets.TEST_YML }}" | base64 --decode > src/test/resources/application-test.yml | ||
# find src | ||
# | ||
# - name: Set up MariaDB 10 | ||
# uses: getong/[email protected] | ||
# with: | ||
# host port: 3306 | ||
# container port: 3306 | ||
# mysql database: 'nanaland_test' | ||
# mysql user: 'root' | ||
# mysql password: ${{ secrets.DATABASE_KEY }} | ||
# | ||
# # 3) gradlew 권한 설정 | ||
# - name: Grant execute permission for gradlew | ||
# run: chmod +x gradlew | ||
# # working-directory: ${{ env.working-directory }} | ||
# | ||
# # 4) gradle 빌드 | ||
# - name: Build with Gradle | ||
# run: ./gradlew clean test -i | ||
# # run: ./gradlew clean build -i | ||
# # working-directory: ${{ env.working-directory }} |