Skip to content

build: Refactor Dockerfile for multi-arch support and improved build … #4

build: Refactor Dockerfile for multi-arch support and improved build …

build: Refactor Dockerfile for multi-arch support and improved build … #4

name: Build and Push Docker Image
on:
push:
branches: [ "main" ]
pull_request:
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up QEMU (for multi-arch, optional)
uses: docker/setup-qemu-action@v2
with:
platforms: amd64,arm64
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
- name: Build and Push
uses: docker/build-push-action@v4
with:
context: .
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ secrets.DOCKER_HUB_USERNAME }}/kubebadges:latest