diff --git a/.gitea/workflows/builder.yaml b/.gitea/workflows/builder.yaml new file mode 100644 index 0000000..cdefcb2 --- /dev/null +++ b/.gitea/workflows/builder.yaml @@ -0,0 +1,23 @@ +name: Image builder +on: + release: + types: [released] + push: + +jobs: + build: + container: + image: git.halis.io/athens-school/runner-images:debian12.1-node18 + runs-on: [arm64] + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + - name: Login to register + uses: https://gitea.com/docker/login-action@v2 + with: + registry: https://git.halis.io + username: ${{ github.actor }} + password: ${{ secrets.CONTAINER_TOKEN }} + - name: Start shell build + run: ./build.sh diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..58686c2 --- /dev/null +++ b/build.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +IMAGE_NAME=$(echo $GITHUB_SERVER_URL/$GITHUB_REPOSITORY | tr '[:upper:]' '[:lower:]' | cut -d '/' -f3-) + +for d in ./images/* +do + 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