Files
traberph 8f8c662e5e
Build image / build (push) Successful in 34s
update branding and ci
2026-09-26 12:02:12 +02:00

49 lines
1.3 KiB
YAML

name: Build image
on:
push:
branches: [main]
tags: ["v*"]
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 }}