when:
  event: [push, manual]
  branch: [dev, stage, main]

labels:
  platform: arm64

steps:
  - name: build-push
    image: docker
    commands:
      - if [ "$CI_COMMIT_BRANCH" = "main" ]; then export TAG=arm; else export TAG=${CI_COMMIT_BRANCH}-arm; fi
      - docker build -f Dockerfile.jetson -t localhost:5000/detections:$TAG .
      - docker push localhost:5000/detections:$TAG
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
