diff --git a/.gitea/workflows/build-image.yml b/.gitea/workflows/build-image.yml index cb389031..9e859a28 100644 --- a/.gitea/workflows/build-image.yml +++ b/.gitea/workflows/build-image.yml @@ -37,7 +37,7 @@ jobs: username: ${{ gitea.actor }} password: ${{ secrets.PACKAGES_TOKEN }} - - name: Determine image tag + - name: Determine image tag and revision id: meta run: | if [ -n "${{ inputs.tag }}" ]; then @@ -46,6 +46,7 @@ jobs: IMAGE_TAG="$(git rev-parse --short HEAD)" fi echo "image_tag=$IMAGE_TAG" >> $GITHUB_OUTPUT + echo "full_sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT echo "==> Image tag: $IMAGE_TAG" - name: Build and push @@ -59,6 +60,14 @@ jobs: # CHECK_3RD_API 留空 → 三方 API 测试不跑;想跑设 "1" build-args: | BUILD_PIPELINE=1 + # OCI 标签: + # - source 让 Gitea 收包时自动把镜像关联到对应 repo(不再需要手动去 + # "包设置 → 链接到仓库") + # - revision 把构建时的 commit full SHA 烙进镜像 manifest, + # docker inspect 能反推回源码版本 + labels: | + org.opencontainers.image.source=https://git.zhengchentao.win/dev/ezbookkeeping + org.opencontainers.image.revision=${{ steps.meta.outputs.full_sha }} tags: | git.zhengchentao.win/dev/ezbookkeeping:${{ steps.meta.outputs.image_tag }} git.zhengchentao.win/dev/ezbookkeeping:latest \ No newline at end of file