name: Build KabOS Image

on:
  workflow_dispatch:

jobs:
  build:
    runs-on: docker

    steps:
      - name: Clone repo manually
        run: |
          git clone http://host.docker.internal:3000/mkm1971/kabos-os.git .
          ls -la

      - name: Install tools
        run: |
          apt update
          apt install -y podman git

      - name: Build bootable image
        run: |
          podman pull localhost/kabos-nvidia:latest

          podman run --rm --privileged \
            -v /var/lib/containers:/var/lib/containers \
            -v $(pwd):/output \
            quay.io/centos-bootc/bootc-image-builder:latest \
            --type qcow2 \
            localhost/kabos-nvidia:latest

      - name: List output
        run: |
          ls -lah