From 872499957105c41039ec6b4065cdd555ae91fb29 Mon Sep 17 00:00:00 2001 From: SeongWonYoon Date: Mon, 2 Dec 2024 20:36:43 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20docker-compose.yml=20=EB=A1=9C=EA=B7=B8?= =?UTF-8?q?=20=EC=B0=8D=EC=96=B4=EB=B3=B4=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/gradle.yml | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 16f35c4..c3adbc3 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -78,21 +78,22 @@ jobs: sudo docker pull ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_REPOSITORY }} # Create .env file in the correct directory - echo "SPRING_DATASOURCE_URL=${{ secrets.SPRING_DATASOURCE_URL }}" > ~/wabi/.env - echo "SPRING_DATASOURCE_USERNAME=${{ secrets.SPRING_DATASOURCE_USERNAME }}" >> ~/wabi/.env - echo "SPRING_DATASOURCE_PASSWORD=${{ secrets.SPRING_DATASOURCE_PASSWORD }}" >> ~/wabi/.env - echo "JWT_KEY=${{ secrets.JWT_KEY }}" >> ~/wabi/.env - echo "JWT_EXPIRATION_HOURS=${{ secrets.JWT_EXPIRATION_HOURS }}" >> ~/wabi/.env - echo "JWT_ISSUER=${{ secrets.JWT_ISSUER }}" >> ~/wabi/.env - echo "DOCKERHUB_USERNAME=${{ secrets.DOCKERHUB_USERNAME }}" >> ~/wabi/.env - echo "DOCKERHUB_REPOSITORY=${{ secrets.DOCKERHUB_REPOSITORY }}" >> ~/wabi/.env + echo "SPRING_DATASOURCE_URL=${{ secrets.SPRING_DATASOURCE_URL }}" > .env + echo "SPRING_DATASOURCE_USERNAME=${{ secrets.SPRING_DATASOURCE_USERNAME }}" >> .env + echo "SPRING_DATASOURCE_PASSWORD=${{ secrets.SPRING_DATASOURCE_PASSWORD }}" >> .env + echo "JWT_KEY=${{ secrets.JWT_KEY }}" >> .env + echo "JWT_EXPIRATION_HOURS=${{ secrets.JWT_EXPIRATION_HOURS }}" >> .env + echo "JWT_ISSUER=${{ secrets.JWT_ISSUER }}" >> .env + echo "DOCKERHUB_USERNAME=${{ secrets.DOCKERHUB_USERNAME }}" >> .env + echo "DOCKERHUB_REPOSITORY=${{ secrets.DOCKERHUB_REPOSITORY }}" >> - # Navigate to the correct directory for docker-compose - cd ~/wabi - - # Bring down any existing containers before bringing up new ones - sudo docker-compose down - sudo docker-compose up -d + if [ -f "docker-compose.yml" ]; then + sudo docker-compose down + sudo docker-compose up -d + else + echo "docker-compose.yml not found in the current directory." + exit 1 + fi