Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5ff1f840dc |
@@ -39,29 +39,16 @@ runs:
|
|||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
# Fixed Podman storage paths — re-derived in each step to avoid
|
rm -rf "${RUNNER_TEMP}/podman-root" "${RUNNER_TEMP}/podman-runroot"
|
||||||
# relying on GITHUB_ENV propagation between composite action steps.
|
mkdir -p "${RUNNER_TEMP}/podman-root" "${RUNNER_TEMP}/podman-runroot"
|
||||||
podman_root="${RUNNER_TEMP}/podman-root"
|
|
||||||
podman_runroot="${RUNNER_TEMP}/podman-runroot"
|
|
||||||
|
|
||||||
rm -rf "${podman_root}" "${podman_runroot}"
|
# Validate tags early so failures are caught before build starts
|
||||||
mkdir -p "${podman_root}" "${podman_runroot}"
|
|
||||||
|
|
||||||
# Export only input-derived values that cannot be recomputed later.
|
|
||||||
{
|
|
||||||
echo "IMAGE_BASE=registry.noctrl.eu/${{ inputs.image-name }}"
|
|
||||||
} >> "${GITHUB_ENV}"
|
|
||||||
|
|
||||||
# Parse and validate tags
|
|
||||||
mapfile -t tags < <(printf '%s\n' "${{ inputs.tags }}" | tr ', ' '\n\n' | sed '/^$/d')
|
mapfile -t tags < <(printf '%s\n' "${{ inputs.tags }}" | tr ', ' '\n\n' | sed '/^$/d')
|
||||||
if [[ ${#tags[@]} -eq 0 ]]; then
|
if [[ ${#tags[@]} -eq 0 ]]; then
|
||||||
echo "ERROR: no tags resolved from inputs.tags" >&2
|
echo "ERROR: no tags resolved from inputs.tags" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Export tags as newline-separated string for subsequent steps
|
|
||||||
(IFS=$'\n'; echo "IMAGE_TAGS=${tags[*]}") >> "${GITHUB_ENV}"
|
|
||||||
|
|
||||||
- id: login
|
- id: login
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
@@ -87,6 +74,7 @@ runs:
|
|||||||
--storage-driver vfs
|
--storage-driver vfs
|
||||||
)
|
)
|
||||||
|
|
||||||
|
image_base="registry.noctrl.eu/${{ inputs.image-name }}"
|
||||||
build_cmd=(podman "${podman_args[@]}" build --isolation chroot -f "${{ inputs.containerfile }}")
|
build_cmd=(podman "${podman_args[@]}" build --isolation chroot -f "${{ inputs.containerfile }}")
|
||||||
|
|
||||||
# Add build args
|
# Add build args
|
||||||
@@ -99,9 +87,9 @@ runs:
|
|||||||
echo "Building image with tags:"
|
echo "Building image with tags:"
|
||||||
while IFS= read -r tag; do
|
while IFS= read -r tag; do
|
||||||
[[ -z "${tag}" ]] && continue
|
[[ -z "${tag}" ]] && continue
|
||||||
echo " ${IMAGE_BASE}:${tag}"
|
echo " ${image_base}:${tag}"
|
||||||
build_cmd+=(-t "${IMAGE_BASE}:${tag}")
|
build_cmd+=(-t "${image_base}:${tag}")
|
||||||
done <<< "${IMAGE_TAGS}"
|
done < <(printf '%s\n' "${{ inputs.tags }}" | tr ', ' '\n\n' | sed '/^$/d')
|
||||||
|
|
||||||
build_cmd+=("${{ inputs.context }}")
|
build_cmd+=("${{ inputs.context }}")
|
||||||
"${build_cmd[@]}"
|
"${build_cmd[@]}"
|
||||||
@@ -117,9 +105,11 @@ runs:
|
|||||||
--storage-driver vfs
|
--storage-driver vfs
|
||||||
)
|
)
|
||||||
|
|
||||||
|
image_base="registry.noctrl.eu/${{ inputs.image-name }}"
|
||||||
|
|
||||||
echo "Pushing image tags:"
|
echo "Pushing image tags:"
|
||||||
while IFS= read -r tag; do
|
while IFS= read -r tag; do
|
||||||
[[ -z "${tag}" ]] && continue
|
[[ -z "${tag}" ]] && continue
|
||||||
echo " ${IMAGE_BASE}:${tag}"
|
echo " ${image_base}:${tag}"
|
||||||
podman "${podman_args[@]}" push "${IMAGE_BASE}:${tag}"
|
podman "${podman_args[@]}" push "${image_base}:${tag}"
|
||||||
done <<< "${IMAGE_TAGS}"
|
done < <(printf '%s\n' "${{ inputs.tags }}" | tr ', ' '\n\n' | sed '/^$/d')
|
||||||
|
|||||||
Reference in New Issue
Block a user