diff --git a/.gitea/workflows/cd.yml b/.gitea/workflows/cd.yml index ba2322f..3c8bb55 100644 --- a/.gitea/workflows/cd.yml +++ b/.gitea/workflows/cd.yml @@ -69,9 +69,21 @@ jobs: env: DOCKER_HOST: tcp://192.168.88.40:2375 run: | - sleep 10 + # Wait for playout to stabilize (it may restart during init) + sleep 20 curl -f http://192.168.88.40:3000/health || exit 1 - docker exec linearvoid-playout curl -sf http://localhost + # Retry playout health check since it may still be initializing + for i in $(seq 1 6); do + if docker exec linearvoid-playout curl -sf http://localhost:8081/health; then + echo "Playout is healthy" + exit 0 + fi + echo "Playout not ready yet (attempt $i/6), waiting 5s..." + sleep 5 + done + echo "Playout failed to become healthy after 6 attempts" + docker logs linearvoid-playout --tail 50 + exit 1 curl -f http://192.168.88.40:3000/health || exit 1 docker exec linearvoid-playout curl -sf http://localhost:8081/health || exit 1 diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 87e66a1..093702f 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -119,13 +119,23 @@ jobs: type=raw,value=latest,enable={{is_default_branch}} - name: Build and push Nginx image - uses: docker/build-push-action@v5 - with: - context: . - dockerfile: infrastructure/nginx/Dockerfile - push: true - tags: ${{ steps.meta-nginx.outputs.tags }} - labels: ${{ steps.meta-nginx.outputs.labels }} + run: | + TAGS="${{ steps.meta-nginx.outputs.tags }}" + LABELS="${{ steps.meta-nginx.outputs.labels }}" + TAG_ARGS="" + for tag in $TAGS; do + TAG_ARGS="$TAG_ARGS --tag $tag" + done + LABEL_ARGS="" + while IFS= read -r label; do + [ -n "$label" ] && LABEL_ARGS="$LABEL_ARGS --label $label" + done <<< "$LABELS" + docker buildx build \ + --push \ + --file infrastructure/nginx/Dockerfile \ + $TAG_ARGS \ + $LABEL_ARGS \ + . release: needs: docker