Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions .github/workflows/docker-build-push.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Build and Push Docker Image

on:
push:
branches:
- '**'
Comment thread
sourcery-ai[bot] marked this conversation as resolved.
Resolved
Comment thread
sourcery-ai[bot] marked this conversation as resolved.
Resolved

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Comment thread
sourcery-ai[bot] marked this conversation as resolved.
Resolved
cancel-in-progress: true

permissions:
contents: read

jobs:
build-and-push:
name: Build & Push Docker Image
runs-on: ubuntu-latest
if: github.repository_owner == 'kruize'

steps:
- name: Checkout repository
uses: actions/checkout@v4

- 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 Quay.io
uses: docker/login-action@v3
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME || secrets.QUAY_ROBOT_NAME || secrets.QUAY_USER }}
password: ${{ secrets.QUAY_ROBOT_TOKEN || secrets.QUAY_PASSWORD || secrets.QUAY_TOKEN }}

- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: quay.io/kruizehub/kruize-operator
tags: |
type=ref,event=branch
Comment thread
sourcery-ai[bot] marked this conversation as resolved.
Resolved

- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
file: Dockerfile
platforms: linux/amd64,linux/arm64
Comment thread
sourcery-ai[bot] marked this conversation as resolved.
Resolved
push: true
provenance: false
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
Loading