diff --git a/.github/workflows/distribution-deploy.yml b/.github/workflows/distribution-deploy.yml index b96a0f3d7..55d7c5e4c 100644 --- a/.github/workflows/distribution-deploy.yml +++ b/.github/workflows/distribution-deploy.yml @@ -11,6 +11,9 @@ jobs: - name: Checkout code uses: actions/checkout@v4 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Log in to GitHub Container Registry uses: docker/login-action@v3 with: @@ -20,7 +23,8 @@ jobs: - name: Build Client Docker image run: | - docker build \ + docker buildx build \ + --platform linux/amd64,linux/arm64 \ -t ghcr.io/bluewave-labs/checkmate:frontend-dist \ -f ./docker/dist/client.Dockerfile \ --label org.opencontainers.image.source=https://github.com/bluewave-labs/checkmate \ @@ -36,6 +40,9 @@ jobs: - name: Checkout code uses: actions/checkout@v4 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Log in to GitHub Container Registry uses: docker/login-action@v3 with: @@ -45,7 +52,8 @@ jobs: - name: Build Server Docker image run: | - docker build \ + docker buildx build \ + --platform linux/amd64,linux/arm64 \ -t ghcr.io/bluewave-labs/checkmate:backend-dist \ -f ./docker/dist/server.Dockerfile \ --label org.opencontainers.image.source=https://github.com/bluewave-labs/checkmate \ @@ -56,7 +64,8 @@ jobs: - name: Build Mongo Docker image run: | - docker build \ + docker buildx build \ + --platform linux/amd64,linux/arm64 \ -t ghcr.io/bluewave-labs/checkmate:mongo-dist \ -f ./docker/dist/mongoDB.Dockerfile \ --label org.opencontainers.image.source=https://github.com/bluewave-labs/checkmate \ @@ -67,7 +76,8 @@ jobs: - name: Build Redis Docker image run: | - docker build \ + docker buildx build \ + --platform linux/amd64,linux/arm64 \ -t ghcr.io/bluewave-labs/checkmate:redis-dist \ -f ./docker/dist/redis.Dockerfile \ --label org.opencontainers.image.source=https://github.com/bluewave-labs/checkmate \ diff --git a/docker/dist/build_images.sh b/docker/dist/build_images.sh index e0d83a5d8..ccfa9cc85 100755 --- a/docker/dist/build_images.sh +++ b/docker/dist/build_images.sh @@ -11,11 +11,12 @@ declare -A services=( ["bluewaveuptime/uptime_server"]="./docker/dist/server.Dockerfile" ) -# Loop through each service and build the corresponding image for service in "${!services[@]}"; do - docker build -f "${services[$service]}" -t "$service" . - - # Check if the build succeeded + docker buildx build \ + --platform linux/amd64,linux/arm64 \ + -f "${services[$service]}" \ + -t "$service" \ + if [ $? -ne 0 ]; then echo "Error building $service image. Exiting..." exit 1 diff --git a/server/service/notificationService.js b/server/service/notificationService.js index 624056694..e4f343c80 100755 --- a/server/service/notificationService.js +++ b/server/service/notificationService.js @@ -257,9 +257,7 @@ class NotificationService { const alerts = { cpu: cpuThreshold !== -1 && cpuUsage > cpuThreshold ? true : false, memory: memoryThreshold !== -1 && memoryUsage > memoryThreshold ? true : false, - disk: disk.some((d) => diskThreshold !== -1 && d.usage_percent > diskThreshold) - ? true - : false, + disk: disk?.some(d => diskThreshold !== -1 && typeof d?.usage_percent === "number" && d?.usage_percent > diskThreshold) ?? false, }; const notifications = await this.db.getNotificationsByMonitorId(