Skip to content

Feat/#13

Feat/#13 #26

Workflow file for this run

name: Java CI with Gradle
on:
push:
branches: [ "main", "develop" ]
pull_request:
branches: [ "main", "develop" ]
jobs:
build:
runs-on: ubuntu-latest
# CI 서버 내부에서 테스트용 DB/Redis 컨테이너 실행
services:
mysql:
image: mysql:8.0
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: where_you_ad
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
redis:
image: redis:latest
ports:
- 6379:6379
options: --health-cmd="redis-cli ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: 'gradle'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew build
# CI용, 환경변수로 DB 설정
env:
DB_URL: jdbc:mysql://localhost:3306/where_you_ad?serverTimezone=Asia/Seoul
DB_USERNAME: root
DB_PASSWORD: root
REDIS_HOST: localhost
REDIS_PORT: 6379
MAIL_USERNAME: test@example.com
MAIL_PASSWORD: test_password
JWT_SECRET: dGhpcy1pcy1hLXRlc3Qtc2VjcmV0LWtleS1mb3ItY2ktdGVzdC1wdXJwb3Nlcw==