diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index 15958d6..aa2bfde 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -18,7 +18,7 @@ jobs: - name: Build docker image run: | cd YaeBlog - podman build . -t registry.cn-beijing.aliyuncs.com/jackfiled/blog:latest + podman build . -t registry.cn-beijing.aliyuncs.com/jackfiled/blog:latest --build-arg COMMIT_ID=$(git rev-parse --short=10 HEAD) - name: Workaround to make sure podman login succeed run: | mkdir /root/.docker diff --git a/YaeBlog/Components/Foonter.razor b/YaeBlog/Components/Foonter.razor index 8a5935b..6318f05 100644 --- a/YaeBlog/Components/Foonter.razor +++ b/YaeBlog/Components/Foonter.razor @@ -7,11 +7,15 @@ 驱动。

+

+ Build Commit # + +

- 蜀ICP备2022004429号-1 +

@@ -19,4 +23,8 @@ @code { private string DotnetVersion => $".NET {Environment.Version}"; + + private string BuildCommitId => Environment.GetEnvironmentVariable("COMMIT_ID") ?? "local_build"; + + private string BuildCommitUrl => $"https://git.rrricardo.top/jackfiled/YaeBlog/commit/{BuildCommitId}"; } diff --git a/YaeBlog/Dockerfile b/YaeBlog/Dockerfile index 8883495..fc49c56 100644 --- a/YaeBlog/Dockerfile +++ b/YaeBlog/Dockerfile @@ -1,5 +1,8 @@ FROM mcr.microsoft.com/dotnet/aspnet:9.0 +ARG COMMIT_ID +ENV COMMIT_ID=${COMMIT_ID} + WORKDIR /app COPY bin/Release/net9.0/publish/ ./ COPY source/ ./source/