name: Distribution deploy - Monolithic Multiarch

on:
  push:
    branches: ["master"]
  workflow_dispatch:
jobs:
  docker-build-and-push-server:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v4

      - name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v3

      - name: Log in to GitHub Container Registry
        uses: docker/login-action@v3
        with:
          registry: ghcr.io
          username: ${{ github.actor }}
          password: ${{ secrets.GITHUB_TOKEN }}

      - name: Build and push multi-arch Docker image
        uses: docker/build-push-action@v5
        with:
          context: .
          file: ./docker/dist-arm/server.Dockerfile
          push: true
          tags: ghcr.io/bluewave-labs/checkmate:backend-dist-mono-multiarch
          platforms: linux/amd64,linux/arm64
          labels: |
            org.opencontainers.image.source=https://github.com/bluewave-labs/checkmate

      # - name: Build Server Docker image
      #   run: |
      #     docker build \
      #       -t ghcr.io/bluewave-labs/checkmate:backend-dist-mono-multiarch \
      #       -f ./docker/dist-arm/server.Dockerfile \
      #       --label org.opencontainers.image.source=https://github.com/bluewave-labs/checkmate \
      #       .

      # - name: Push Server Docker image
      #   run: docker push ghcr.io/bluewave-labs/checkmate:backend-dist-mono-multiarch
