fix(pub-con): Check if tar or zip to allow apptainers

This commit is contained in:
2026-01-30 16:32:58 +01:00
parent 5e54e04eef
commit c6adb94cf0
3 changed files with 19 additions and 12 deletions
+10 -6
View File
@@ -62,19 +62,23 @@ runs:
skopeo login \
--username "${{ github.actor }}" \
--password "${{ inputs.container-token }}" \
"${{ vars.REGISTRY }}"
"${{ inputs.REGISTRY }}"
# Build container
nix-build -A containers."${{ inputs.project }}" \
--argstr env "${{ steps.envvars.outputs.ENV }}"
# The Nix build creates a compressed tar.gz file, we need to extract it first
IMAGE_TAR="$(readlink -f result)"
cd /tmp/skopeo
cp ${GITHUB_WORKSPACE}/result ./docker-image.tar.gz
gunzip docker-image.tar.gz
# ls -alh ./result
# skopeo inspect docker-archive://$(readlink -f ./result)
if file "${IMAGE_TAR}" | grep -qi gzip; then
echo "Detected gzip-compressed image"
cp "${IMAGE_TAR}" docker-image.tar.gz
gunzip docker-image.tar.gz
else
echo "Detected uncompressed image"
cp "${IMAGE_TAR}" docker-image.tar
fi
echo "Pushing image: ${{ steps.envvars.outputs.IMAGE_NAME }}"
skopeo copy \