🧪 Test building with Kaniko #20
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |