Refactor build.yml for Chunkah and image handling
Removed invalid 'image-archive' argument and adjusted annotations for Chunkah run.
This commit is contained in:
@@ -107,7 +107,7 @@ jobs:
|
|||||||
# Das kritische ostree-Label explizit auslesen, falls vorhanden
|
# Das kritische ostree-Label explizit auslesen, falls vorhanden
|
||||||
OSTREE_DIFFID=$(podman inspect $BASE_IMAGE --format '{{index .Config.Labels "ostree.final-diffid"}}' 2>/dev/null || echo "")
|
OSTREE_DIFFID=$(podman inspect $BASE_IMAGE --format '{{index .Config.Labels "ostree.final-diffid"}}' 2>/dev/null || echo "")
|
||||||
|
|
||||||
# Chunkah-Lauf: Annotation explizit übergeben, falls vorhanden
|
# Chunkah-Lauf: Annotation explizit übergeben
|
||||||
ANNOTATION_ARG=""
|
ANNOTATION_ARG=""
|
||||||
if [ ! -z "$OSTREE_DIFFID" ]; then
|
if [ ! -z "$OSTREE_DIFFID" ]; then
|
||||||
ANNOTATION_ARG="--annotation ostree.final-diffid=$OSTREE_DIFFID"
|
ANNOTATION_ARG="--annotation ostree.final-diffid=$OSTREE_DIFFID"
|
||||||
@@ -127,6 +127,24 @@ jobs:
|
|||||||
--output /outputs/image.ociarchive \
|
--output /outputs/image.ociarchive \
|
||||||
--rootfs /inputs
|
--rootfs /inputs
|
||||||
|
|
||||||
|
# WIEDER EINGEFÜGT: Das OCI-Archiv in Podman laden, damit die Action es findet
|
||||||
|
podman rmi $BASE_IMAGE || true
|
||||||
|
podman load -i ./chunkah-out/image.ociarchive
|
||||||
|
|
||||||
|
# Image sauber taggen
|
||||||
|
IMAGE_ID=$(podman images --filter "dangling=true" --format "{{.ID}}" | head -n 1)
|
||||||
|
if [ -z "$IMAGE_ID" ]; then
|
||||||
|
IMAGE_ID=$(podman images --format "{{.ID}} {{.Repository}}" | grep -v "chunkah" | head -n 1 | awk '{print $1}')
|
||||||
|
fi
|
||||||
|
podman tag $IMAGE_ID $BASE_IMAGE
|
||||||
|
|
||||||
|
# WIEDER EINGEFÜGT: Die restlichen Tags für Datum, etc. lokal erzeugen
|
||||||
|
- name: Tag for registry
|
||||||
|
run: |
|
||||||
|
for tag in ${{ steps.metadata.outputs.tags }}; do
|
||||||
|
podman tag ${{ env.IMAGE_NAME }}:${{ env.DEFAULT_TAG }} ${{ env.IMAGE_NAME }}:$tag
|
||||||
|
done
|
||||||
|
|
||||||
- name: Login to GitHub Container Registry
|
- name: Login to GitHub Container Registry
|
||||||
uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v3
|
uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v3
|
||||||
if: github.event_name != 'pull_request' && github.ref == format('refs/heads/{0}', github.event.repository.default_branch)
|
if: github.event_name != 'pull_request' && github.ref == format('refs/heads/{0}', github.event.repository.default_branch)
|
||||||
@@ -148,7 +166,7 @@ jobs:
|
|||||||
tags: ${{ steps.metadata.outputs.tags }}
|
tags: ${{ steps.metadata.outputs.tags }}
|
||||||
username: ${{ env.REGISTRY_USER }}
|
username: ${{ env.REGISTRY_USER }}
|
||||||
password: ${{ env.REGISTRY_PASSWORD }}
|
password: ${{ env.REGISTRY_PASSWORD }}
|
||||||
image-archive: ./chunkah-out/image.ociarchive
|
# KORREKTUR: "image-archive" entfernt, da ungültig.
|
||||||
extra-args: --compression-format=zstd --compression-level=5
|
extra-args: --compression-format=zstd --compression-level=5
|
||||||
|
|
||||||
- name: Install Cosign
|
- name: Install Cosign
|
||||||
|
|||||||
Reference in New Issue
Block a user