From 6284896e1d70cf2bba917ed85c0da1be30409b08 Mon Sep 17 00:00:00 2001 From: gitea_admin Date: Mon, 27 Apr 2026 11:19:13 +0000 Subject: [PATCH] Add .gitea/workflows/build-and-push.yaml --- .gitea/workflows/build-and-push.yaml | 55 ++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 .gitea/workflows/build-and-push.yaml diff --git a/.gitea/workflows/build-and-push.yaml b/.gitea/workflows/build-and-push.yaml new file mode 100644 index 0000000..7613c5c --- /dev/null +++ b/.gitea/workflows/build-and-push.yaml @@ -0,0 +1,55 @@ +name: Build and Push Container Image + +on: + push: + branches: + - main + tags: + - "v*" + +env: + REGISTRY: ${{ gitea.server_url }} + IMAGE_NAME: ${{ gitea.repository }} + +jobs: + build-and-push: + runs-on: orchestration-platform + container: + image: gcr.io/kaniko-project/executor:debug + options: --entrypoint="" + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Determine image tag + id: meta + run: | + if echo "${{ gitea.ref }}" | grep -q "refs/tags/"; then + TAG=$(echo "${{ gitea.ref }}" | sed 's|refs/tags/||') + else + TAG="latest" + fi + echo "tag=${TAG}" >> "$GITHUB_OUTPUT" + + - name: Build and push image + run: | + REGISTRY_HOST=$(echo "${REGISTRY}" | sed 's|https\?://||') + AUTH=$(echo -n "${{ gitea.actor }}:${{ secrets.REGISTRY_TOKEN }}" | base64) + + mkdir -p /kaniko/.docker + cat > /kaniko/.docker/config.json <