diff --git a/.github/workflows/search-service-ci-cd.yml b/.github/workflows/search-service-ci-cd.yml index 62428859..9acbdd5c 100644 --- a/.github/workflows/search-service-ci-cd.yml +++ b/.github/workflows/search-service-ci-cd.yml @@ -50,7 +50,7 @@ jobs: - name: Verify if the correct JAR file exists run: | - ls service-search-1.0.0-SNAPSHOT.jar || (echo "JAR file not found!" && exit 1) + ls target/service-search-*.jar || (echo "JAR file not found!" && exit 1) - name: Add Server to Known Hosts run: | @@ -59,7 +59,7 @@ jobs: - name: Transfer JAR to VPS run: | - sshpass -p "${{ secrets.DEPLOYMENT_MACHINE_USER_PSW }}" scp ./service-search-1.0.0-SNAPSHOT.jar \ + sshpass -p "${{ secrets.DEPLOYMENT_MACHINE_USER_PSW }}" scp ./target/service-search-*.jar \ ${{ secrets.DEPLOYMENT_MACHINE_USER }}@${{ secrets.DEPLOYMENT_MACHINE_IP }}:~/service-search/service-search.jar - name: Verify if the JAR file exists on the VPS @@ -83,13 +83,13 @@ jobs: echo "Starting Spring Boot service..." cd ~/service-search - nohup java -jar service-search.jar --server.port=8082 > service-search.log 2>&1 & + nohup java -jar service-search.jar --server.port=8089 > service-search.log 2>&1 & echo "Spring Boot service deployed successfully!" sleep 30 echo "Performing health check..." - curl -X 'GET' 'http://localhost:8082/products' -H 'accept: /' || (echo "Service health check failed!" && exit 1) + curl -X 'GET' 'http://localhost:8082/actuator/health' -H 'accept: application/json' || (echo "Service health check failed!" && exit 1) echo "Service deployed and healthy!"