diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index 698a1be..fe1d7b5 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -86,6 +86,8 @@ jobs: if: contains(github.ref, 'main') run: | docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} + docker build -f Dockerfile -t ${{ secrets.DOCKER_USERNAME }}/hello-counsellor . + docker push ${{ secrets.DOCKER_USERNAME }}/hello-counsellor - name: Deploy to prod uses: appleboy/ssh-action@master diff --git a/.github/workflows/develop-ci.yml b/.github/workflows/develop-ci.yml index 9527997..c27f303 100644 --- a/.github/workflows/develop-ci.yml +++ b/.github/workflows/develop-ci.yml @@ -80,26 +80,4 @@ jobs: run: ./gradlew clean - name: Build with gradle - run: ./gradlew build - - - name: Docker build & push to prod - if: contains(github.ref, 'main') - run: | - docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} - docker build -f Dockerfile -t ${{ secrets.DOCKER_USERNAME }}/hello-counsellor . - docker push ${{ secrets.DOCKER_USERNAME }}/hello-counsellor - - - name: Deploy to prod - uses: appleboy/ssh-action@master - id: deploy-prod - if: contains(github.ref, 'main') - with: - host: ${{ secrets.HOST_PROD }} # EC2 퍼블릭 IPv4 DNS - username: ubuntu - key: ${{ secrets.PRIVATE_KEY }} - envs: GITHUB_SHA - script: | - sudo docker ps - sudo docker pull ${{ secrets.DOCKER_USERNAME }}/hello-counsellor - sudo docker run -d -p 8080:8080 ${{ secrets.DOCKER_USERNAME }}/hello-counsellor - sudo docker image prune -f \ No newline at end of file + run: ./gradlew build \ No newline at end of file