Files
sexy/.gitea/workflows/docker-build-backend.yml
Sebastian Krüger 3fd876180a
All checks were successful
Build and Push Frontend Image / build (push) Successful in 1m11s
ci: link Docker images to Gitea repository via OCI source label
docker/metadata-action uses github.* context vars which are empty in
Gitea Actions. Explicitly set org.opencontainers.image.source using
gitea.server_url and gitea.repository so the container registry links
each image back to this repository.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-10 17:04:45 +01:00

71 lines
1.9 KiB
YAML

name: Build and Push Backend Image
on:
push:
branches:
- main
- develop
tags:
- "v*.*.*"
paths:
- "packages/backend/**"
- "packages/types/**"
- "Dockerfile.backend"
pull_request:
branches:
- main
paths:
- "packages/backend/**"
- "packages/types/**"
- "Dockerfile.backend"
workflow_dispatch:
env:
REGISTRY: dev.pivoine.art
IMAGE_NAME: valknar/sexy-backend
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
platforms: linux/amd64
- name: Log in to Gitea Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ gitea.actor }}
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
labels: |
org.opencontainers.image.source=${{ gitea.server_url }}/${{ gitea.repository }}
tags: |
type=raw,value=latest,enable={{is_default_branch}}
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=sha,prefix={{branch}}-
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.backend
platforms: linux/amd64
push: ${{ gitea.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache
cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache,mode=max