Skip to content

Update helm/kind-action action to v1.12.0 #225

Update helm/kind-action action to v1.12.0

Update helm/kind-action action to v1.12.0 #225

name: create and push docker image
on:
workflow_dispatch:
pull_request:
push:
tags:
- "v*.*.*"
branches:
- main
paths-ignore:
- "README.md"
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
permissions:
contents: read
packages: write
jobs:
build-and-push:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- postfix: ""
features: ""
- postfix: "-face"
features: "--features face_recognition"
steps:
- name: checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: set up QEMU
uses: docker/setup-qemu-action@v3
- name: set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: compute tag
uses: actions/github-script@v7
id: compute-tag
with:
result-encoding: string
script: |
if (context.eventName === "pull_request") {
return "pr-" + context.issue.number + "${{ matrix.postfix }}";
}
if (context.eventName === "release") {
return "latest" + "${{ matrix.postfix }}";
}
if (context.eventName === "push") {
if (context.ref.startsWith("refs/tags/")) {
return context.ref.slice(10) + "${{ matrix.postfix }}";
}
if (context.ref === "refs/heads/main") {
return "nightly" + "${{ matrix.postfix }}";
}
}
return "FALSE";
- name: extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
# set latest tag for default branch
type=raw,value={{date 'YYYYMMDD-hhmmss' tz='Europe/Berlin'}}
type=ref,event=pr
type=sha
type=raw,value=${{steps.compute-tag.outputs.result}}
type=raw,value=nightly,enable={{is_default_branch}}
- name: build and push
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
build-args: featureflag=${{ matrix.features }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=min