Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4474157

Browse files
committed
ci: tag built docker images with current version
1 parent 21abefa commit 4474157

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

.github/workflows/build-docker.yaml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,21 @@ jobs:
3030
password: ${{ secrets.GITHUB_TOKEN }}
3131

3232
- name: Build and push
33+
id: docker_build
3334
uses: docker/build-push-action@v4
3435
with:
3536
context: .
3637
file: "docker/simple/Dockerfile"
37-
push: true # push to registry
38-
pull: true # always fetch the latest base images
39-
platforms: linux/amd64,linux/arm64 # build for both amd64 and arm64
40-
tags: ghcr.io/abetlen/llama-cpp-python:latest
38+
push: ${{ startsWith(github.ref, 'refs/tags/') }}
39+
pull: true
40+
platforms: linux/amd64,linux/arm64
41+
tags: |
42+
ghcr.io/abetlen/llama-cpp-python:latest
43+
ghcr.io/abetlen/llama-cpp-python:${{ github.ref_name }}
44+
build-args: |
45+
BUILDKIT_INLINE_CACHE=1
46+
47+
- name: Publish to GitHub Tag
48+
if: steps.docker_build.outputs.digest && startsWith(github.ref, 'refs/tags/')
49+
run: |
50+
echo "Docker image published for tag: ${{ github.ref_name }

0 commit comments

Comments
 (0)