Skip to content

Commit 9ac29da

Browse files
committed
Set version and created tags on the image
1 parent aa0d40b commit 9ac29da

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

.github/workflows/build-ssp.container.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,17 @@ jobs:
2121
- name: Set up Docker Buildx
2222
uses: docker/setup-buildx-action@v3
2323

24+
- name: Create version tag
25+
id: version
26+
run: |
27+
# Get the tag that triggered the workflow if it exists
28+
# If no tag exists, use the commit hash as the version
29+
if [ -n "${GITHUB_TAG}" ]; then
30+
echo "version=${GITHUB_TAG}" >> $GITHUB_OUTPUT
31+
else
32+
echo "version=${GITHUB_SHA}" >> $GITHUB_OUTPUT
33+
fi
34+
2435
- name: Login to GitHub Container Registry
2536
uses: docker/login-action@v3
2637
with:
@@ -37,3 +48,5 @@ jobs:
3748
tags: |
3849
ghcr.io/openconext/openconext-devssp/devssp:latest
3950
ghcr.io/openconext/openconext-devssp/devssp:${{ github.sha }}
51+
org.opencontainers.image.created: ${{ events.created_at }}
52+
org.opencontainers.image.version: ${{ version.version }}

0 commit comments

Comments
 (0)