From 4474157949b16f7fb9e553b751e08af94f82481d Mon Sep 17 00:00:00 2001 From: Andrei Betlen Date: Thu, 23 Nov 2023 01:06:47 -0500 Subject: [PATCH] ci: tag built docker images with current version --- .github/workflows/build-docker.yaml | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-docker.yaml b/.github/workflows/build-docker.yaml index 4b38dba..17f67fd 100644 --- a/.github/workflows/build-docker.yaml +++ b/.github/workflows/build-docker.yaml @@ -30,11 +30,21 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push + id: docker_build uses: docker/build-push-action@v4 with: context: . file: "docker/simple/Dockerfile" - push: true # push to registry - pull: true # always fetch the latest base images - platforms: linux/amd64,linux/arm64 # build for both amd64 and arm64 - tags: ghcr.io/abetlen/llama-cpp-python:latest \ No newline at end of file + push: ${{ startsWith(github.ref, 'refs/tags/') }} + pull: true + platforms: linux/amd64,linux/arm64 + tags: | + ghcr.io/abetlen/llama-cpp-python:latest + ghcr.io/abetlen/llama-cpp-python:${{ github.ref_name }} + build-args: | + BUILDKIT_INLINE_CACHE=1 + + - name: Publish to GitHub Tag + if: steps.docker_build.outputs.digest && startsWith(github.ref, 'refs/tags/') + run: | + echo "Docker image published for tag: ${{ github.ref_name }