forgejo-kaniko-action/action.yml

34 lines
1 KiB
YAML
Raw Permalink Normal View History

2023-11-13 03:34:04 +01:00
---
name: Kaniko
description: Build a container image using Kaniko
inputs:
Dockerfile:
description: The Dockerfile to pass to Kaniko
required: true
image:
description: Name and tag under which to upload the image
required: true
registry:
description: Domain of the registry. Should be the same as the first path component of the tag.
required: true
username:
description: Username for the container registry
2023-11-13 04:20:34 +01:00
required: true
2023-11-13 03:34:04 +01:00
password:
description: Password for the container registry
2023-11-13 04:20:34 +01:00
required: true
2023-11-13 03:34:04 +01:00
runs:
using: docker
image: docker://gcr.io/kaniko-project/executor:debug
entrypoint: /bin/sh
2023-11-13 04:10:22 +01:00
args:
- -c
- |
mkdir -p /kaniko/.docker
echo '{"auths":{"${{ inputs.registry }}":{"auth":"'$(printf "%s:%s" "${{ inputs.username }}" "${{ inputs.password }}" | base64 | tr -d '\n')'"}}}' > /kaniko/.docker/config.json
2023-11-13 04:12:11 +01:00
cat > Dockerfile <<EOF
2023-11-13 04:10:22 +01:00
${{ inputs.Dockerfile }}
EOF
2023-11-13 04:12:11 +01:00
/kaniko/executor --dockerfile Dockerfile --destination ${{ inputs.image }}