feat: deploy setting #1
Workflow file for this run
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
name: gradle build | |
on: | |
pull_request: | |
branches: [ develop ] | |
# 권한 설정 | |
permissions: write-all | |
# Work | |
jobs: | |
build: | |
runs-on: ubuntu-latest # 실행 환경 | |
steps: | |
- uses: actions/checkout@v3 # 기본 체크아웃 동작 | |
# Java version 세팅 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
# 환경 변수 설정 | |
- name: Set up Environment | |
run: echo "${{ secrets.ENV_PROPERTIES }}" > ./.env # GitHub SecretKey 에서 설정한 내용으로 .env 파일 생성 | |
# 테스트를 위해 Github 서버에 docker로 mysql 띄우기 | |
- name: Create Mysql Docker Container | |
run: sudo docker run -d -p 3306:3306 --env MYSQL_DATABASE="${{ secrets.TEST_DATABASE }}" --env MYSQL_ROOT_PASSWORD="${{ secrets.TEST_DATASOURCE_PASSWORD }}" latest | |
# 빌드시 캐시 적용 | |
- name: Cache Gradle Packages | |
uses: actions/cache@v3 | |
with: | |
path: ~/.gradle/caches | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle', '**/gradle-wrapper.properties') }} | |
restore-keys: ${{ runner.os }}-gradle | |
# 빌드 | |
- name: Build with Gradle | |
run: ./gradlew build |