first commit

This commit is contained in:
ange 2025-10-21 17:10:36 +00:00
commit 46b20aa03d
Signed by: ange
GPG key ID: 9E0C4157BB7BEB1D
4 changed files with 52 additions and 0 deletions

28
entrypoint.sh Executable file
View file

@ -0,0 +1,28 @@
#!/bin/sh -ex
#shellcheck disable=SC1091
[ -f .env ] && . ./.env
if [ -z "$IMAGEAPP" ]; then
REGISTRY="$(echo "$GITHUB_SERVER_URL" | sed 's .*:// ')"
IMAGEAPP="$REGISTRY/$INPUT_IMAGE"
fi
if [ "$INPUT_CACHE" = true ]; then
set -- --import-cache "type=registry,ref=$IMAGEAPP/cache" \
--export-cache "type=registry,ref=$IMAGEAPP/cache"
fi
cat <<EOF > "$DOCKER_CONFIG/config.json"
{
"auths": {
"$GITHUB_SERVER_URL": {
"username": "$INPUT_USERNAME",
"password": "$INPUT_PASSWORD"
}
}
}
EOF
buildctl build "$@" -o "type=image,name=$IMAGEAPP,push=true" \
--local context="$(dirname "$INPUT_DOCKERFILE")" \
--local dockerfile="$INPUT_DOCKERFILE"