feat: show live build version in web UI
Build & Push Docker Image / build (push) Successful in 2m36s
Build & Push Docker Image / build (push) Successful in 2m36s
- /api/version returns version, commitSha, buildDate, trashRetentionDays - CI passes COMMIT_SHA (full), BUILD_DATE and VERSION (git tag) as docker build args; Dockerfile bakes them as env - sidebar footer shows version/sha linked to the Gitea commit - admin System tab shows version, commit link, build date, trash retention
This commit is contained in:
@@ -27,8 +27,14 @@ jobs:
|
||||
- name: Build and push
|
||||
run: |
|
||||
SHA=$(git rev-parse --short HEAD)
|
||||
FULL_SHA=$(git rev-parse HEAD)
|
||||
IMAGE="git.kubebase.de/${{ gitea.repository }}"
|
||||
docker build --no-cache -t "${IMAGE}:sha-${SHA}" -t "${IMAGE}:latest" .
|
||||
if [ "${{ gitea.ref_type }}" = "tag" ]; then VERSION="${{ gitea.ref_name }}"; else VERSION=""; fi
|
||||
docker build --no-cache \
|
||||
--build-arg COMMIT_SHA="$FULL_SHA" \
|
||||
--build-arg BUILD_DATE="$(date -u +"%Y-%m-%dT%H:%M:%SZ")" \
|
||||
--build-arg VERSION="$VERSION" \
|
||||
-t "${IMAGE}:sha-${SHA}" -t "${IMAGE}:latest" .
|
||||
docker push "${IMAGE}:sha-${SHA}"
|
||||
docker push "${IMAGE}:latest"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user