fix(pub-con): Check if tar or zip to allow apptainers
This commit is contained in:
@@ -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 \
|
||||
|
||||
Reference in New Issue
Block a user