generate OCI image labels with docker/metadata-action instead of hardcoding them in Dockerfiles

This commit is contained in:
Athou
2026-11-08 13:07:30 +01:00
parent 0be041c906
commit 103ba252f8
3 changed files with 12 additions and 2 deletions

View File

@@ -147,6 +147,12 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Docker metadata
id: meta
uses: docker/metadata-action@dc802804100637a589fabce1cb79ff13a1411302 # v6.2.0
with:
images: athou/commafeed
## build but don't push for PRs and renovate
- name: Docker build - native
uses: docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc # v7.4.0
@@ -155,6 +161,7 @@ jobs:
file: commafeed-server/src/main/docker/Dockerfile.native
push: false
platforms: linux/amd64,linux/arm64/v8
labels: ${{ steps.meta.outputs.labels }}
- name: Docker build - jvm
uses: docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc # v7.4.0
@@ -163,6 +170,7 @@ jobs:
file: commafeed-server/src/main/docker/Dockerfile.jvm
push: false
platforms: linux/amd64,linux/arm64/v8
labels: ${{ steps.meta.outputs.labels }}
## build and push tag
- name: Docker build and push tag - native
@@ -173,6 +181,7 @@ jobs:
file: commafeed-server/src/main/docker/Dockerfile.native
push: ${{ env.DOCKERHUB_USERNAME != '' }}
platforms: linux/amd64,linux/arm64/v8
labels: ${{ steps.meta.outputs.labels }}
tags: |
athou/commafeed:latest-${{ matrix.database }}
athou/commafeed:${{ github.ref_name }}-${{ matrix.database }}
@@ -185,6 +194,7 @@ jobs:
file: commafeed-server/src/main/docker/Dockerfile.jvm
push: ${{ env.DOCKERHUB_USERNAME != '' }}
platforms: linux/amd64,linux/arm64/v8
labels: ${{ steps.meta.outputs.labels }}
tags: |
athou/commafeed:latest-${{ matrix.database }}-jvm
athou/commafeed:${{ github.ref_name }}-${{ matrix.database }}-jvm
@@ -198,6 +208,7 @@ jobs:
file: commafeed-server/src/main/docker/Dockerfile.native
push: ${{ env.DOCKERHUB_USERNAME != '' }}
platforms: linux/amd64,linux/arm64/v8
labels: ${{ steps.meta.outputs.labels }}
tags: athou/commafeed:master-${{ matrix.database }}
- name: Docker build and push master - jvm
@@ -208,6 +219,7 @@ jobs:
file: commafeed-server/src/main/docker/Dockerfile.jvm
push: ${{ env.DOCKERHUB_USERNAME != '' }}
platforms: linux/amd64,linux/arm64/v8
labels: ${{ steps.meta.outputs.labels }}
tags: athou/commafeed:master-${{ matrix.database }}-jvm
release: