fix cd pipeline #2

Merged
marcio.fernandes merged 14 commits from tests/ci-cd into main 2026-03-15 10:57:17 +00:00
Showing only changes of commit 3c10ca756a - Show all commits

View File

@@ -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