runner-images/build.sh
2023-08-07 11:09:54 +02:00

19 lines
527 B
Bash
Executable File

#!/bin/sh
echo $CONTAINER_TOKEN | docker login git.halis.io -u $GITHUB_ACTOR --password-stdin
IMAGE_NAME=$(echo $GITHUB_SERVER_URL/$GITHUB_REPOSITORY | tr '[:upper:]' '[:lower:]' | cut -d '/' -f3-)
for d in ./images/*
do
echo "Loading $d"
for i in $d/*
do
echo "Building $i"
DISTRO=$(echo $i | cut -d '/' -f 3)
VERSION=$(echo $i | cut -d '/' -f 4 | cut -d '.' -f2-)
docker build -f $i . -t $IMAGE_NAME:$DISTRO$VERSION
docker push $IMAGE_NAME:$DISTRO$VERSION
done
done