refactor: Jpa 관련 설정 infrastructure 모듈로 이동 및 api 모듈 내 jpa 디펜던시 제거 (#45) #10
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: "[DEV] Build and Deploy" | |
on: | |
push: | |
branches: | |
- develop | |
jobs: | |
build-deploy: | |
environment: dev | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
- name: Set up JDK 21 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: temurin | |
java-version: '21' | |
- name: Build with Gradle (skip tests) | |
run: ./gradlew build -x test | |
- name: Build Docker Image | |
run: | | |
docker build -f clog-api/Dockerfile -t ${{ secrets.DOCKER_REGISTRY }}/${{ secrets.DOCKER_IMAGE }}:${{ github.ref_name }} . | |
- name: Login to Docker Registry | |
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login ${{ secrets.DOCKER_REGISTRY }} -u ${{ secrets.DOCKER_USERNAME }} --password-stdin | |
- name: Push Docker Image | |
run: docker push ${{ secrets.DOCKER_REGISTRY }}/${{ secrets.DOCKER_IMAGE }}:${{ github.ref_name }} | |
- name: Deploy on Remote Server via SSH | |
uses: appleboy/[email protected] | |
with: | |
host: ${{ secrets.SSH_HOST }} | |
username: ${{ secrets.SSH_USERNAME }} | |
password: ${{ secrets.SSH_PASSWORD }} | |
port: ${{ secrets.SSH_PORT }} | |
script: | | |
docker compose -f /root/docker-compose.yml pull api | |
docker compose -f /root/docker-compose.yml up -d api |