name: Test-Build Docker Image

on:
  workflow_dispatch:
  push:

jobs:
  bake-test:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v6
      - name: Docker Setup QEMU
        uses: docker/setup-qemu-action@v3
        with:
          platforms: all
      - name: Docker Setup Buildx
        uses: docker/setup-buildx-action@v3
      - name: Build (full)
        uses: docker/build-push-action@v6
        with:
          context: .
          file: ./docker/docker-py3-kms/Dockerfile
          platforms: linux/amd64,linux/386,linux/arm64/v8,linux/arm/v7,linux/arm/v6
          push: false
          build-args: |
            BUILD_COMMIT=${{ github.sha }}
            BUILD_REFERENCE=${{ github.ref_name }}
      - name: Build (minimal)
        uses: docker/build-push-action@v6
        with:
          context: .
          file: ./docker/docker-py3-kms-minimal/Dockerfile
          platforms: linux/amd64,linux/386,linux/arm64/v8,linux/arm/v7,linux/arm/v6
          push: false
          build-args: |
            BUILD_COMMIT=${{ github.sha }}
            BUILD_REFERENCE=${{ github.ref_name }}
