[fix]:DB 매핑 수정 / eventboard 로직 수정 #54
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 Spring Boot | |
| on: | |
| push: | |
| branches: ["main"] | |
| jobs: | |
| build-and-push: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v3 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '17' | |
| - name: Build Spring Boot JAR | |
| run: | | |
| chmod +x ./gradlew | |
| ./gradlew clean build -x test | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to Naver Cloud Registry | |
| run: | | |
| echo "${{ secrets.NCP_SECRET_KEY }}" | docker login \ | |
| -u ${{ secrets.NCP_ACCESS_KEY }} \ | |
| --password-stdin ${{ secrets.NCP_REGISTRY }} | |
| - name: Build Docker Image | |
| run: | | |
| docker build -t ${{ secrets.NCP_REGISTRY }}/${{ secrets.NCP_REPO_NAME }}:latest . | |
| - name: Push Docker Image | |
| run: | | |
| docker push ${{ secrets.NCP_REGISTRY }}/${{ secrets.NCP_REPO_NAME }}:latest | |
| remote-deploy: | |
| needs: build-and-push | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: SSH Remote Deploy | |
| uses: appleboy/ssh-action@v1.1.0 | |
| with: | |
| host: ${{ secrets.SERVER_HOST }} | |
| username: ubuntu | |
| key: ${{ secrets.SERVER_SSH_KEY }} | |
| script: | | |
| echo "Running remote deploy script..." | |
| bash /home/ubuntu/deploy.sh |