modified: .gitea/actions/buildkit-build-push/action.yaml
Some checks failed
/ build-image (push) Failing after 15s
Some checks failed
/ build-image (push) Failing after 15s
This commit is contained in:
@@ -31,19 +31,24 @@ runs:
|
|||||||
- name: Authenticate to Gitea registry
|
- name: Authenticate to Gitea registry
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
# Create a temporary file inside GITHUB_TEMP
|
|
||||||
DOCKER_CONFIG_FILE="${RUNNER_TEMP}/docker_config.json"
|
|
||||||
|
|
||||||
# Ensure cleanup ALWAYS happens
|
DOCKER_CONFIG_DIR="${RUNNER_TEMP}/.buildctl_docker"
|
||||||
trap 'rm -f "$DOCKER_CONFIG_FILE"' EXIT
|
mkdir -p "$DOCKER_CONFIG_DIR"
|
||||||
|
|
||||||
|
# clean up
|
||||||
|
trap 'rm -rf "$DOCKER_CONFIG_DIR"' EXIT
|
||||||
|
|
||||||
# Generate auth entry
|
|
||||||
AUTH=$(printf "%s" "${{ inputs.registry_username }}:${{ inputs.registry_password }}" | base64 -w 0)
|
AUTH=$(printf "%s" "${{ inputs.registry_username }}:${{ inputs.registry_password }}" | base64 -w 0)
|
||||||
|
|
||||||
printf '{"auths":{"%s":{"auth":"%s"}}}' \
|
cat > "$DOCKER_CONFIG_DIR/config.json" <<EOF
|
||||||
"${{ inputs.registry_addr }}" \
|
{
|
||||||
"$AUTH" \
|
"auths": {
|
||||||
> "$DOCKER_CONFIG_FILE"
|
"${{ inputs.registry_addr }}": {
|
||||||
|
"auth": "$AUTH"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
|
||||||
# Run BuildKit build
|
# Run BuildKit build
|
||||||
buildctl \
|
buildctl \
|
||||||
@@ -53,5 +58,6 @@ runs:
|
|||||||
--local context=${{ inputs.context }} \
|
--local context=${{ inputs.context }} \
|
||||||
--local dockerfile=${{ inputs.dockerfile }} \
|
--local dockerfile=${{ inputs.dockerfile }} \
|
||||||
--opt filename=Dockerfile \
|
--opt filename=Dockerfile \
|
||||||
--output type=image,name=${{ inputs.tags }},push=true,registry.config=$DOCKER_CONFIG_FILE
|
--output type=image,name=${{ inputs.tags }},push=true,registry.config=$DOCKER_CONFIG_DIR
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user