Skip to content

🧪 Test building with Kaniko #20

🧪 Test building with Kaniko

🧪 Test building with Kaniko #20

Workflow file for this run

name: 🧪 Test building with Kaniko
on:
workflow_dispatch:
jobs:
build:
runs-on: [kaniko-worker]
container:
image: gcr.io/kaniko-project/executor:debug
permissions:
contents: read
packages: write
steps:
- name: Build and push container test
run: |
# Write config file
AUTH=$(echo -n ${{ github.actor }}:${{ secrets.GITHUB_TOKEN }} | base64)
echo "{\"auths\": {\"ghcr.io\": {\"auth\": \"${AUTH}\"}}}" > /kaniko/.docker/config.json
# Configure git
export GIT_USERNAME="kaniko-bot"
export GIT_PASSWORD="${{ secrets.GITHUB_TOKEN }}"
# Build and push
/kaniko/executor --dockerfile="./images/ubi9.Dockerfile" \
--context="${{ github.repositoryUrl }}#${{ github.ref }}#${{ github.sha }}" \
--destination="ghcr.io/some-natalie/kubernoodles/kaniko-build:test" \
--push-retry 5 \
--build-arg opts="TARGETPLATFORM=linux/amd64" \
--image-name-with-digest-file /workspace/image-digest.txt