Skip to content

Commit ad03ca0

Browse files
committed
feat: improved container tagging and labeling
1 parent 22643cf commit ad03ca0

1 file changed

Lines changed: 19 additions & 1 deletion

File tree

.github/workflows/build-and-deploy.yml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ on:
55
tags:
66
- 'v*'
77

8+
env:
9+
REGISTRY: ghcr.io
10+
IMAGE_NAME: gemini-cli
11+
812
jobs:
913
build-and-push:
1014
runs-on: ubuntu-latest
@@ -31,12 +35,26 @@ jobs:
3135
username: ${{ github.actor }}
3236
password: ${{ secrets.GITHUB_TOKEN }}
3337

38+
- name: Extract metadata (tags, labels) for Docker
39+
id: meta
40+
uses: docker/metadata-action@v5
41+
with:
42+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
43+
tags: |
44+
type=semver,pattern={{version}}
45+
type=semver,pattern={{major}}.{{minor}}
46+
type=semver,pattern={{major}}
47+
type=sha
48+
type=raw,value=latest,enable={{is_default_branch}}
49+
labels: |
50+
org.opencontainers.image.maintainer=Ophios GmbH
3451
- name: Build and push Docker image
3552
id: build_and_push
3653
uses: docker/build-push-action@v5
3754
with:
3855
context: .
3956
push: true
40-
tags: ghcr.io/${{ github.repository }}:${{ steps.get_version.outputs.VERSION }}
57+
tags: ${{ steps.meta.outputs.tags }}
58+
labels: ${{ steps.meta.outputs.labels }}
4159
build-args: |
4260
GEMINI_CLI_VERSION=${{ steps.get_version.outputs.VERSION }}

0 commit comments

Comments
 (0)