feature/new-oci-deployment #2
@@ -38,27 +38,6 @@ runs:
|
||||
- name: run buildctl build and push
|
||||
shell: bash
|
||||
run: |
|
||||
###############################################
|
||||
# Create DOCKER_CONFIG for this pipeline
|
||||
###############################################
|
||||
|
||||
DOCKER_CONFIG_DIR="${RUNNER_TEMP}/.buildctl_docker"
|
||||
mkdir -p "$DOCKER_CONFIG_DIR"
|
||||
|
||||
trap 'rm -rf "$DOCKER_CONFIG_DIR"' EXIT
|
||||
|
||||
AUTH=$(printf "%s:%s" "${{ inputs.registry_username }}" "${{ inputs.registry_password }}" | base64 -w0)
|
||||
|
||||
cat > "$DOCKER_CONFIG_DIR/config.json" <<EOF
|
||||
{
|
||||
"auths": {
|
||||
"${{ inputs.registry_addr }}": {
|
||||
"auth": "$AUTH"
|
||||
}
|
||||
}
|
||||
}
|
||||
EOF
|
||||
|
||||
###############################################
|
||||
# Build args
|
||||
###############################################
|
||||
@@ -72,7 +51,13 @@ runs:
|
||||
echo "Using build args: $BUILD_ARG_FLAGS"
|
||||
|
||||
###############################################
|
||||
# Build + push using BuildKit REMOTE + SECRET
|
||||
# Inline auth for BuildKit remote push
|
||||
###############################################
|
||||
|
||||
AUTH_INLINE=$(printf "%s:%s" "${{ inputs.registry_username }}" "${{ inputs.registry_password }}" | base64 -w0)
|
||||
|
||||
###############################################
|
||||
# Build + push using BuildKit REMOTE + INLINE AUTH
|
||||
###############################################
|
||||
|
||||
buildctl \
|
||||
@@ -83,6 +68,4 @@ runs:
|
||||
--local dockerfile=${{ inputs.dockerfile }} \
|
||||
--opt filename=${{ inputs.filename }} \
|
||||
$BUILD_ARG_FLAGS \
|
||||
--secret id=harbor,src=$DOCKER_CONFIG_DIR/config.json \
|
||||
--opt secret=harbor \
|
||||
--output type=image,name=${{ inputs.tags }},push=true
|
||||
--output type=image,name=${{ inputs.tags }},push=true,registry.auth=$AUTH_INLINE
|
||||
|
||||
@@ -16,6 +16,7 @@ jobs:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
|
||||
|
||||
- name: Fetch limbo public actions
|
||||
env:
|
||||
RUNNER_TEMP: "${{ runner.temp }}"
|
||||
|
||||
Reference in New Issue
Block a user