Files
test_repo/.gitea/workflows/build-and-push.yaml
gitea_admin 6e9e3f962f
Some checks failed
Build and Push Container Image / build-and-push (push) Failing after 10s
Update .gitea/workflows/build-and-push.yaml
2026-04-27 11:32:09 +00:00

36 lines
932 B
YAML

name: Build and Push Container Image
on:
push:
branches:
- main
tags:
- "v*"
jobs:
build-and-push:
runs-on: orchestration-platform
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: Login to Gitea registry
run: |
echo "${{ secrets.REGISTRY_TOKEN }}" | docker login ${{ gitea.server_url }} -u ${{ gitea.actor }} --password-stdin
- name: Build and push image
run: |
IMAGE="${{ gitea.server_url }}/${{ gitea.repository }}:${{ steps.meta.outputs.tag }}"
docker build -t "${IMAGE}" .
docker push "${IMAGE}"