Refactor the image detection strategy in the build-images workflow.
- Remove the `image` input parameter from `workflow_dispatch`.
- Update detection logic to handle events differently:
- On manual triggers (`workflow_dispatch`), the script now scans the `images/` directory and builds ALL valid images found.
- On push events, the script retains the `git diff` logic to only build images that have explicitly changed.
The variable name `matrix` in the `detect-changes` job output was ambiguous and potentially confusing, as `matrix` is a reserved keyword in Gitea/GitHub Actions syntax for defining job strategies.
This change renames the output variable to `image_list` to better reflect its content (a JSON array of image names) and avoid naming conflicts or confusion with the actual `strategy.matrix` configuration.
Changes:
- Renamed output `matrix` to `image_list` in `detect-changes` job.
- Updated all shell script references in the change detection logic.
- Updated the consumer job `build-push-images` to use `needs.detect-changes.outputs.image_list`.
Refactor the 'Detect changed images' step in the build-images workflow to improve robustness and debuggability.
Changes include:
- Pass `inputs.image` via an environment variable (`INPUT_IMAGE`) to avoid potential injection issues or syntax errors in shell scripts.
- Add comprehensive `DEBUG` echo statements to trace the logic flow for both manual and automatic detection paths.
- Use `printf` instead of `echo` for writing to `$GITHUB_OUTPUT` to ensure safer handling of string outputs.
- Remove redundant comments to clean up the script block.
Updated the image detection step in the `.gitea/workflows/build-images.yml` workflow to better handle manual inputs and automatic change detection.
Changes:
- Reorganized the logic to handle manual inputs first; if a manual input is present, it validates the image, sets the output matrix immediately, and exits, bypassing git diff checks.
- Added explicit error handling and output setting for invalid or empty manual inputs to prevent workflow failure confusion.
- Grouped the Git diff detection logic into a distinct block that runs only if no manual input is provided.
- Added a debug echo statement to the build job to verify the current matrix image being built.
Updates the `build-images` workflow to robustly detect and validate changes to image directories.
Changes:
- Implements strict validation to ensure detected image directories exist and contain a `Dockerfile` before adding them to the build matrix.
- Normalizes logic for both manual inputs and automatic git-diff detection using a temporary file (`valid_images.txt`) to collect targets.
- Adds specific checks to warn if a manually specified image is missing or invalid.
- Prevents the build job from failing or running unnecessarily if an empty image name is passed to the matrix by adding an early exit condition.
Updates the image building workflow to improve reliability and readability.
Changes:
- Replaced the complex `moby/buildkit` container-in-container execution with standard Docker build and push steps.
- Added explicit checkout, login, and build steps to the job matrix.
- Improved the change detection logic:
- Added input sanitization (whitespace trimming) for manually triggered builds.
- Added comments explaining the directory diff logic.
- Updated job titles and comments to English for consistency (e.g., "Detect modified images" instead of "Détection des images modifiées").
- Added `fail-fast: false` to the matrix strategy so one failed build doesn't stop others.