From 930189ac4fe350edf7f607521ad50ed225bb212c Mon Sep 17 00:00:00 2001 From: Jarian Cottingham Date: Sun, 5 Jul 2026 05:23:49 +0000 Subject: [PATCH] fix: close #6 - find and build all Dockerfiles in subdirectories CI docker-build job only checked root Dockerfile, but all Dockerfiles live in subdirs (scraper/, articleServer/, etc.). Now uses find to locate all Dockerfile/dockerfile variants and builds each in its directory context. --- .gitea/workflows/ci.yml | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index c0f3dac..7c23808 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -92,13 +92,27 @@ jobs: git clone --depth 1 $GITEA_URL/$GITHUB_REPOSITORY $GITHUB_WORKSPACE git -C $GITHUB_WORKSPACE checkout $GITHUB_SHA 2>/dev/null || true - - name: Build Docker image + - name: Build Docker images if: always() run: | - if [[ -f Dockerfile ]]; then - docker build -t $GITHUB_REPOSITORY:test . - else + DOCKERFILES=$(find . -type f \( -name "Dockerfile" -o -name "dockerfile" \) 2>/dev/null) + if [ -z "$DOCKERFILES" ]; then echo "No Dockerfile found, skipping docker build" + else + echo "Found Dockerfiles:" + echo "$DOCKERFILES" + FAIL=0 + while IFS= read -r df; do + DIR=$(dirname "$df") + NAME=$(basename "$DIR") + echo "Building $DIR/dockerfile as ${NAME}:test..." + docker build -t "${NAME}:test" "$DIR/" || FAIL=1 + done <<< "$DOCKERFILES" + if [ $FAIL -ne 0 ]; then + echo "One or more Docker builds failed" + exit 1 + fi + echo "All Docker images built successfully" fi security: