From 6a557231a1263c2fc0b8eeccd64e5459fa1a4bff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=95=88=EC=A0=95=ED=9B=84?= Date: Tue, 1 Oct 2024 13:51:46 +0900 Subject: [PATCH] test: test for docker pull image --- .github/workflows/cd.yml | 26 ++++---------------------- 1 file changed, 4 insertions(+), 22 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 958050f..52657bb 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -1,4 +1,4 @@ -name: Backend CD # actions 이름 +name: Backend CD on: push: @@ -44,25 +44,7 @@ jobs: - name: 스프링부트 애플리케이션 빌드 run: ./gradlew bootJar - # 도커 이미지 빌드 (Spring Boot) - - name: 도커 이미지 빌드 (Spring Boot) - run: sudo docker build -t ${{ secrets.DOCKER_IMG_SPRING }} --platform linux/amd64 . - - # 도커 이미지 빌드 (Flask 애플리케이션) - - name: 도커 이미지 빌드 (Flask) - run: sudo docker build -t ${{ secrets.DOCKER_IMG_FLASK }} --platform linux/amd64 ./flask-app - - # 도커 이미지 push (Spring Boot) - - name: 도커 이미지 push (Spring Boot) - run: | - sudo docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} - sudo docker push ${{ secrets.DOCKER_IMG_SPRING }} - - # 도커 이미지 push (Flask) - - name: 도커 이미지 push (Flask) - run: | - sudo docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} - sudo docker push ${{ secrets.DOCKER_IMG_FLASK }} + # 도커 이미지 푸시 작업 생략 (이미 빌드된 이미지를 사용) - name: scp file uses: appleboy/scp-action@master @@ -85,7 +67,7 @@ jobs: echo "${{ secrets.DOCKER_COMPOSE }}" > ./docker-compose.yml sudo docker stop $(sudo docker ps -a -q) sudo docker rm -f $(sudo docker ps -qa) - sudo docker pull ${{ secrets.DOCKER_IMG_SPRING }} - sudo docker pull ${{ secrets.DOCKER_IMG_FLASK }} + sudo docker pull ${{ secrets.DOCKER_IMG_SPRING }} # Spring Boot 이미지 풀 + sudo docker pull ${{ secrets.DOCKER_IMG_FLASK }} # Flask 이미지 풀 sudo docker-compose -f docker-compose.yml up -d sudo docker image prune -f