build image with shared traberph/ci workflow

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-16 19:18:44 +02:00
co-authored by Claude Opus 5.5
parent 810eebf09d
commit bf06e79bbe
2 changed files with 22 additions and 44 deletions
+13 -38
View File
@@ -7,42 +7,17 @@ on:
pull_request:
workflow_dispatch:
env:
REGISTRY: registry.traberph.de
IMAGE: registry.traberph.de/public/interval_viz
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
- name: Log in to registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Image tags
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.IMAGE }}
# main-<sha>-<unix time> sorts by build time, for Flux image automation
tags: |
type=raw,value=latest,enable={{is_default_branch}}
type=raw,value=main-{{sha}}-{{date 'X'}},enable={{is_default_branch}}
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
# Tags and build steps are shared across repos, see traberph/ci.
image:
uses: traberph/ci/.gitea/workflows/image.yaml@main
with:
project: public
image: interval_viz
push: ${{ github.event_name != 'pull_request' }}
secrets:
registry-username: ${{ secrets.REGISTRY_USERNAME }}
registry-token: ${{ secrets.REGISTRY_TOKEN }}
# Public image; also pushed to Docker Hub once these secrets exist.
dockerhub-username: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub-token: ${{ secrets.DOCKERHUB_TOKEN }}