Commit Graph

27 Commits

Author SHA1 Message Date
7555c25a58 feat: add input to select specific image for manual trigger 2025-12-08 08:05:28 +00:00
6af9ff9ab2 refactor: remove matrix strategy, use simple loop instead 2025-12-08 08:00:17 +00:00
b6c84481f2 fix: improve JSON format with awk and add matrix debug output 2025-12-08 07:51:21 +00:00
38f2020e44 fix: simplify image detection with for loop and add debug output 2025-12-08 07:40:19 +00:00
79be3d2f9a fix: use gitea.event_name instead of github.event_name, simplify detection logic 2025-12-08 07:36:21 +00:00
darnodo
9e9006439b ci: refine image build matrix generation logic and tools
Updates the build-images workflow to improve reliability and reduce dependency on external tools like `jq`.

- Replaced `jq` with `python3` for generating the JSON matrix, removing the need to install a separate binary and allowing for more standard standard library usage.
- Switched from a shell glob loop (`for DIR in images/*`) to `find` for more robust directory discovery when detecting manual triggers.
- Added explanatory comments regarding fallback behavior for push events.
- Added debug logging for the generated JSON output.
2025-12-07 21:20:07 +01:00
darnodo
a6f7c9799f ci(workflow): build all images on manual trigger instead of specific input
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.
2025-12-07 21:10:57 +01:00
darnodo
95e251f2f2 ci(workflows): rename output variable matrix to image_list
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`.
2025-12-07 21:06:39 +01:00
darnodo
44d9527c95 ci(workflows): enhance debug logging and safety in image detection
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.
2025-12-07 21:02:52 +01:00
darnodo
3458b1c8a0 ci: refine image detection logic in build workflow
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.
2025-12-07 20:58:54 +01:00
darnodo
528a24beb0 ci: improve image detection logic in build workflow
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.
2025-12-07 20:54:26 +01:00
darnodo
2241f39e50 ci: refactor build pipeline to use standard docker commands
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.
2025-12-07 20:40:56 +01:00
0a490015d2 fix: add --entrypoint sh to override buildkitd default entrypoint 2025-12-07 18:59:33 +00:00
e930f2dea6 refactor: run git clone + build inside single buildkit container 2025-12-07 18:20:21 +00:00
10ff5e5a4e fix: use docker volumes to share context between containers 2025-12-07 18:17:46 +00:00
55d54d9eda refactor: use docker:cli + buildkit daemonless via socket 2025-12-07 18:16:14 +00:00
fbab2854c6 refactor: switch to Kaniko (no daemon, no privileged mode needed) 2025-12-07 18:10:21 +00:00
fedd5814f3 fix: use $HOME/build instead of /workspace, remove apk install (git already in image) 2025-12-07 18:02:14 +00:00
9d816609b2 fix: replace actions/checkout with manual git clone (no Node dependency) 2025-12-07 17:56:16 +00:00
6f4b8a203f docs: update README for alpine-based image
Some checks failed
Build and Push Docker Images / detect-changes (push) Failing after 6s
Build and Push Docker Images / build (push) Has been skipped
2025-12-07 17:53:06 +00:00
d1173e6254 refactor: use Buildkit rootless for fully containerized builds 2025-12-07 17:52:52 +00:00
bbbd3364a6 refactor: use alpine base for lighter image
Some checks failed
Build and Push Docker Images / detect-changes (push) Failing after 7s
Build and Push Docker Images / build (push) Has been skipped
2025-12-07 17:52:27 +00:00
067fb69c8f docs: add comprehensive README 2025-12-07 17:18:14 +00:00
b5e2ff347d ci: add Buildkit workflow for multi-image builds 2025-12-07 17:17:50 +00:00
21672041fb docs: add README for terraform-ci image 2025-12-07 17:17:35 +00:00
e7e2ed8e2c feat: add terraform-ci image with tflint 2025-12-07 17:17:29 +00:00
b78f65978c Initial commit 2025-12-07 17:17:21 +00:00