Skip to content

Deploy: DB mysql로 마이그레이션 구현 #92

Deploy: DB mysql로 마이그레이션 구현

Deploy: DB mysql로 마이그레이션 구현 #92

Workflow file for this run

name: Run Tests on Pull Request
on:
pull_request:
branches:
- Weekly
jobs:
test:
runs-on: ubuntu-latest
services:
redis:
image: redis:alpine
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
mysql:
image: mysql:8.0
ports:
- 3306:3306
env:
MYSQL_DATABASE: ${{ secrets.MYSQL_DATABASE }}
MYSQL_USER: ${{ secrets.MYSQL_USERNAME }}
MYSQL_PASSWORD: ${{ secrets.MYSQL_PASSWORD }}
MYSQL_ROOT_PASSWORD: ${{ secrets.MYSQL_ROOT_PASSWORD }}
options: >-
--health-cmd "mysqladmin ping --silent"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
- name: Set environment variables for database
run: |
echo "spring.datasource.url=${{ secrets.MYSQL_URL }}" >> $GITHUB_ENV
echo "spring.datasource.username=${{ secrets.MYSQL_USERNAME }}" >> $GITHUB_ENV
echo "spring.datasource.password=${{ secrets.MYSQL_PASSWORD }}" >> $GITHUB_ENV
echo "spring.jpa.hibernate.ddl-auto=create" >> $GITHUB_ENV
- name: Run Tests
env:
JWT_SECRET: ${{ secrets.JWT_SECRET }}
run: ./gradlew test