fix: Refresh Token 재발급 추가 #77 (#78) #19
This file contains hidden or 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: Deploy to EC2 | |
| on: | |
| push: | |
| branches: | |
| - dev # dev 브랜치에 push 될 때 자동 배포 | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| # 1. 코드 체크아웃 | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| # 2. Java 17 세팅 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '17' | |
| # 3. Gradle 빌드 | |
| - name: Build with Gradle | |
| run: | | |
| chmod +x ./gradlew | |
| ./gradlew clean build -x test | |
| # 4. Docker Hub 로그인 | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| # 5. Docker 이미지 빌드 & 푸시 | |
| - name: Build and push Docker image | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| push: true | |
| tags: choehyungwon/memory-app:latest | |
| # 6. EC2 SSH 접속 후 배포 | |
| - name: Deploy to EC2 | |
| uses: appleboy/ssh-action@v1.0.3 | |
| with: | |
| host: ${{ secrets.EC2_HOST }} | |
| username: ${{ secrets.EC2_USER }} | |
| key: ${{ secrets.EC2_SSH_KEY }} | |
| script: | | |
| docker pull choehyungwon/memory-app:latest | |
| docker stop memory-app || true | |
| docker rm memory-app || true | |
| docker run -d \ | |
| --name memory-app \ | |
| --network memory-net \ | |
| --restart unless-stopped \ | |
| -p 8081:8081 \ | |
| -e SPRING_DATASOURCE_URL="jdbc:mysql://memory-mysql:3306/memory_db?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Seoul&allowPublicKeyRetrieval=true" \ | |
| -e SPRING_DATASOURCE_USERNAME="memory_user" \ | |
| -e SPRING_DATASOURCE_PASSWORD="memory_password" \ | |
| choehyungwon/memory-app:latest |