Files
test/.gitea/workflows/build.yaml
T
aayalew 49da62c8e2
build-and-push / docker (push) Successful in 16s
fix(demo): tag image as owner/repo for auto package link
Gitea only auto-links packages when the image name matches the repo.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-10 18:15:28 +03:00

40 lines
1.2 KiB
YAML

name: build-and-push
on:
push:
branches: [main, master]
env:
# Hostname only (no scheme) — Gitea container registry on this demo stack.
REGISTRY: gitea-dev.alertaware.com
# act_runner DinD listens on the job host network (see runner config.yaml).
DOCKER_HOST: tcp://127.0.0.1:2375
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set image tag
id: meta
run: echo "tag=${GITHUB_SHA::8}" >> "$GITHUB_OUTPUT"
# GITHUB_TOKEN cannot authenticate to Gitea's /v2/ registry; use a PAT
# with write:package stored as repo secret REGISTRY_TOKEN.
- name: Login to Gitea container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.repository_owner }}
password: ${{ secrets.REGISTRY_TOKEN }}
# Tag as owner/repo so Gitea auto-links the package to this repository.
- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: ${{ env.REGISTRY }}/${{ github.repository }}:${{ steps.meta.outputs.tag }}