Files
ci-actions/docker/action.yaml
T

34 lines
995 B
YAML
Raw Normal View History

2026-09-28 21:00:25 +03:00
name: build & push
description: build & push OCI container images to the Gitea registry
inputs:
name:
description: image name
required: true
tags:
description: newline-separated list of tags to tag the image
required: true
2026-09-28 21:49:37 +03:00
containerfile:
description: target container file to build
required: false
default: Containerfile
2026-09-28 21:00:25 +03:00
runs:
using: composite
steps:
- shell: bash
run: |
2026-09-28 21:33:08 +03:00
repo_url="${{ gitea.event.repository.html_url }}"
2026-09-28 21:27:28 +03:00
repo_host="${repo_url#https://}"
repo_host="${repo_host%%/*}"
docker login --username acti-bot --password ${ACTI_BOT_TOKEN} ${repo_host}
2026-09-28 23:36:42 +03:00
docker build -f ${{ inputs.containerfile }} -t img-${{ gitea.run_id }} .
2026-09-28 21:00:25 +03:00
while IFS= read -r tag; do
[[ -z "$tag" ]] && continue
2026-09-28 21:27:28 +03:00
image="${repo_host}/${{ gitea.repository }}/${{ inputs.name }}:$tag"
2026-09-28 23:36:42 +03:00
docker tag img-${{ gitea.run_id }} $image
2026-09-28 21:27:28 +03:00
docker push $image
2026-09-28 21:00:25 +03:00
done <<< "${{ inputs.tags }}"