commit 2ed4619b685b79f4f523bbd8f39e1ee2c2c77095 Author: Tanner Wright Date: Sat May 23 22:39:44 2026 -0600 composite actions diff --git a/.gitea/actions/kaniko-build/action.yaml b/.gitea/actions/kaniko-build/action.yaml new file mode 100644 index 0000000..8617655 --- /dev/null +++ b/.gitea/actions/kaniko-build/action.yaml @@ -0,0 +1,19 @@ +name: Kaniko Build and Push +description: Build and push a Docker image to the Gitea registry using kaniko +inputs: + repo: + description: Gitea repository name to clone and build + required: true + image: + description: Image name in the registry (defaults to repo name) + required: false + default: '' +runs: + using: composite + steps: + - name: Build and push + shell: sh + env: + REPO: ${{ inputs.repo }} + IMAGE: ${{ inputs.image }} + run: sh ${{ github.action_path }}/build.sh diff --git a/.gitea/actions/kaniko-build/build.sh b/.gitea/actions/kaniko-build/build.sh new file mode 100644 index 0000000..577785b --- /dev/null +++ b/.gitea/actions/kaniko-build/build.sh @@ -0,0 +1,81 @@ +#!/bin/sh +set -e + +IMAGE=${IMAGE:-$REPO} +JOB_NAME="build-${IMAGE}-${GITHUB_SHA:0:8}" + +kubectl apply -f - </dev/null) + FAILED=$(kubectl get job ${JOB_NAME} -n gitea-runner -o jsonpath='{.status.failed}' 2>/dev/null) + if [ -n "$COMPLETE" ]; then + echo "Build succeeded" + kubectl delete job ${JOB_NAME} -n gitea-runner --ignore-not-found + exit 0 + fi + if [ "${FAILED:-0}" -ge 1 ]; then + echo "Build failed, logs:" + kubectl logs -n gitea-runner -l job-name=${JOB_NAME} -c kaniko --tail=100 || true + kubectl delete job ${JOB_NAME} -n gitea-runner --ignore-not-found + exit 1 + fi + sleep 15 +done