docker: Improve git tag/ commit hash integration

This commit is contained in:
OpenSauce04 2026-01-11 14:41:09 +00:00 committed by OpenSauce
parent ce02bd6630
commit 15041eca5f
2 changed files with 20 additions and 3 deletions

View File

@ -1,4 +1,17 @@
mkdir build
#!/bin/bash -ex
docker build -f docker/azahar-room/Dockerfile -t azahar-room .
docker save azahar-room:latest > build/azahar-room.dockerimage
GITREV="`git show -s --format='%h'`" || true
if [ "$GITHUB_REF_TYPE" = "tag" ]; then
TAG_NAME=$GITHUB_REF_NAME
elif [[ -n $GITREV ]]; then
TAG_NAME=$GITREV
else
TAG_NAME=unknown
fi
echo "Tag name is: $TAG_NAME"
docker build -f docker/azahar-room/Dockerfile -t azahar-room:$TAG_NAME .
mkdir -p build
docker save azahar-room:$TAG_NAME > build/azahar-room-$TAG_NAME.dockerimage

View File

@ -292,6 +292,10 @@ jobs:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install tools
run: apk add bash
- name: Fix git ownership
run: git config --global --add safe.directory .
- name: Build Docker image
run: ./.ci/docker.sh
- name: Move Docker image to artifacts directory