#222 [hotfix] db 제약 조건 삭제 #154
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: CD | |
| on: | |
| pull_request: | |
| branches: [ "develop" ] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - name: 체크아웃 | |
| uses: actions/checkout@v3 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v3 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '17' | |
| - name: application.yml 생성 | |
| run: | | |
| mkdir -p src/main/resources | |
| cd src/main/resources | |
| echo "${{ secrets.APPLICATION }}" > ./application.yml | |
| - name: 빌드 | |
| run: | | |
| chmod +x gradlew | |
| ./gradlew build -x test | |
| shell: bash | |
| - name: Docker로그인 | |
| uses: docker/login-action@v2.2.0 | |
| with: | |
| username: ${{ secrets.DOCKER_LOGIN_USERNAME }} | |
| password: ${{ secrets.DOCKER_LOGIN_ACCESSTOKEN }} | |
| - name: Docker 이미지 Push | |
| uses: docker/build-push-action@v4 | |
| with: | |
| context: . | |
| file: ./Dockerfile | |
| push: true | |
| tags: seongmin0229/certi-server | |
| deploy-cd: | |
| needs: build | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - name: EC2 배포 (Docker 컨테이너 재실행) | |
| uses: appleboy/ssh-action@master | |
| with: | |
| host: ${{ secrets.RELEASE_SERVER_IP }} | |
| username: ${{ secrets.RELEASE_SERVER_USER }} | |
| key: ${{ secrets.RELEASE_SERVER_KEY }} | |
| script: | | |
| sudo ./deploy.sh |