#!/bin/bash

echo "Building static assets for dylanbaird.com."
cp -r ../dylanbaird.com .
cd ./dylanbaird.com
npx tailwindcss -i ./src/input.css -o ./src/output.css --minify
rm ./src/input.css
cd ../

echo "Copying static assets for alloro.ca"
mkdir -p alloro.ca
cp ../alloro.ca/index*.html alloro.ca/

echo "Copying static assets for judo.dylanbaird.com"
mkdir -p judo
cp -r ../judo/* judo/

echo "Building Docker container."
docker build -t boulangermontrealais/barrios:caddy .
# docker build -t registry.dylanbaird.com/caddy:latest .

echo "Pushing Docker container to registry."
docker push boulangermontrealais/barrios:caddy
# docker push registry.dylanbaird.com/caddy:latest

echo "Cleaning up artifacts for dylanbaird.com."
rm -rf dylanbaird.com

echo "Cleaning up artifacts for judo.dylanbaird.com."
rm -rf judo

echo "Build and push completed successfully."
