Build ci-python image / build (push) Successful in 1m6s
Der act_runner mountet /var/run/docker.sock bei docker_host:"" bereits automatisch in den Job-Container. Unser zusaetzliches container.options -v ...docker.sock erzeugte "Duplicate mount point: /var/run/docker.sock" und liess den Build fehlschlagen. Docker ist im Job ohnehin verfuegbar. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
53 lines
1.8 KiB
YAML
53 lines
1.8 KiB
YAML
name: Build ci-python image
|
|
|
|
# Baut das ci-python-Image und pusht es in die Gitea-Container-Registry.
|
|
# Tags: :latest (mitlaufend) + :<sha> (unveränderlich, zum Pinnen in Workflows).
|
|
#
|
|
# Voraussetzungen im Runner:
|
|
# - Docker verfügbar (Socket oder DinD) — Image-Bau braucht einen Docker-Daemon.
|
|
# - Secrets: REGISTRY_USER (Gitea-User) + REGISTRY_TOKEN (PAT, Scope package:write).
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
paths:
|
|
- 'python/Dockerfile'
|
|
- '.gitea/workflows/build-ci-python.yml'
|
|
schedule:
|
|
- cron: '0 3 * * 1' # wöchentlicher Rebuild für Basis-Sicherheitsupdates
|
|
workflow_dispatch:
|
|
|
|
env:
|
|
REGISTRY: gitea.inmedias.it
|
|
IMAGE: sko/ci-python
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
# Kein expliziter Socket-Mount: der act_runner mountet /var/run/docker.sock
|
|
# bei docker_host:"" automatisch in den Job-Container. build-push-action
|
|
# redet darüber mit dem Host-Daemon. Ein zusätzliches `-v ...docker.sock`
|
|
# führt zu "Duplicate mount point" (siehe Issue #11).
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Login to Gitea registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ${{ env.REGISTRY }}
|
|
username: ${{ secrets.REGISTRY_USER }}
|
|
password: ${{ secrets.REGISTRY_TOKEN }}
|
|
|
|
- name: Build & push
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: python
|
|
push: true
|
|
tags: |
|
|
${{ env.REGISTRY }}/${{ env.IMAGE }}:latest
|
|
${{ env.REGISTRY }}/${{ env.IMAGE }}:${{ github.sha }}
|
|
cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE }}:buildcache
|
|
cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE }}:buildcache,mode=max
|