diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index 70c1826..9196783 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -24,7 +24,7 @@ jobs: run: chmod +x gradlew - name: Build with Gradle - run: ./gradlew build --no-daemon + run: ./gradlew build - name: Log in to Docker Hub uses: docker/login-action@v3 @@ -34,8 +34,8 @@ jobs: - name: Build and push Docker image run: | - docker build -t ${{ secrets.DOCKER_USERNAME }}/gateway . - docker push ${{ secrets.DOCKER_USERNAME }}/gateway + docker build -t ${{ secrets.DOCKER_USERNAME }}/gateway:latest . + docker push ${{ secrets.DOCKER_USERNAME }}/gateway:latest - name: Deploy to EC2 uses: appleboy/ssh-action@v0.1.5 @@ -47,6 +47,8 @@ jobs: script: | cd /home/ubuntu/sunjoo-server-gateway docker-compose down - git pull origin main docker pull ${{ secrets.DOCKER_USERNAME }}/gateway:latest - docker-compose up -d --build + docker-compose build + docker-compose up -d + docker network connect eureka-network sunjoo-server-gateway-gateway-1 + docker restart sunjoo-server-gateway-gateway-1 diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 429eb73..c785e44 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -12,6 +12,7 @@ spring: cloud: config: enabled: false + gateway: globalcors: corsConfigurations: @@ -37,17 +38,17 @@ spring: - Authorization routes: - id: auth - uri: http://sunjoo-server-auth-spring-1:8090/ + uri: http://13.124.194.48:8090/ predicates: - Path=/auth/** - id: analyze - uri: http://sunjoo-server-sentimentanalysis-sentimentAnalysis-1:8095/ + uri: http://13.124.194.48:8095/ predicates: - Path=/analyze/** filters: - name: AuthorizationHeaderFilter - id: drinktionary - uri: http://sunjoo-server-drinktionary-drinktionary-1:8091/ + uri: http://13.124.194.48:8091/ predicates: - Path=/drinks/** filters: @@ -60,4 +61,5 @@ eureka: register-with-eureka: true fetch-registry: true service-url: - defaultZone: http://sunjoo-server-eureka-eureka-1:8761/eureka/ \ No newline at end of file + defaultZone: http://13.124.194.48:8761/eureka/ +