#!/usr/bin/env bash
set -e

REGISTRY="gitea.gofwd.group"
OWNER="sean/shadow-gunbuilder-ai-proto"
IMAGE="webui"

TAG=$(git rev-parse --short HEAD)

FULL_IMAGE="$REGISTRY/$OWNER/$IMAGE"

echo "Building $FULL_IMAGE:$TAG"
docker build -f frontend/Dockerfile --no-cache -t $FULL_IMAGE:$TAG .

echo "Tagging latest"
docker tag $FULL_IMAGE:$TAG $FULL_IMAGE:latest

echo "Pushing $TAG"
docker push $FULL_IMAGE:$TAG

echo "Pushing latest"
docker push $FULL_IMAGE:latest

echo "Done!"
