name: Build and Push Docker Container
on:
  push:
    tags:
      - 'v*'

jobs:
  build-and-push:
    runs-on:
      - ubuntu-24.04
    steps:
      - name: Login to Docker Hub
        uses: docker/login-action@v3
        with:
          registry: g.eliaskohout.de
          username: ${{ secrets.USERNAME }}
          password: ${{ secrets.ACCESS_TOKEN }}

      - name: Set up QEMU
        uses: docker/setup-qemu-action@v3

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

      - name: Build and push
        uses: docker/build-push-action@v6
        with:
          push: true
          platforms: linux/amd64,linux/arm64
          tags: "g.eliaskohout.de/eliaskohout/axolotl-server:${{gitea.ref_name}},g.eliaskohout.de/eliaskohout/axolotl-server:latest"
