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

3
Dockerfile Normal file
View file

@ -0,0 +1,3 @@
FROM docker.io/moby/buildkit:master-rootless
COPY entrypoint.sh /usr/local/bin/
ENTRYPOINT ["entrypoint.sh"]

1
README.md Normal file
View file

@ -0,0 +1 @@
# buildah@v1

20
action.yaml Normal file
View file

@ -0,0 +1,20 @@
inputs:
dockerfile:
description: Dockerfile path
default: ./Dockerfile
image:
description: Image name and tag
default: ${{ forgejo.repository }}:${{ forgejo.ref_name }}
username:
description: Registry username
default: ${{ forgejo.repository_owner }}
password:
description: Registry password
required: true
cache:
description: Use registry cache
default: true
runs:
using: docker
image: Dockerfile

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"