From c6b2c6fd8f909c1c5ebcab4aa40bb9d17c433bc3 Mon Sep 17 00:00:00 2001 From: Bernat Vadell Date: Thu, 16 Mar 2023 11:44:00 +0100 Subject: [PATCH] include docker versioned images --- .github/workflows/docker.yml | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index eae88a6e3..b1c7098f6 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -10,6 +10,7 @@ name: Publish Docker image on: + pull_request: push: branches: - master @@ -18,13 +19,23 @@ jobs: push_to_registry: name: Push Docker image to Docker Hub runs-on: ubuntu-latest - + env: + COMMIT_SHA: ${{ github.sha }} strategy: matrix: config: - { tag: "latest", dockerfile: ".devops/main.Dockerfile" } - { tag: "full", dockerfile: ".devops/full.Dockerfile" } - + - { + tag: "light", + dockerfile: ".devops/main.Dockerfile", + include_hash: true, + } + - { + tag: "full", + dockerfile: ".devops/full.Dockerfile", + include_hash: true, + } steps: - name: Check out the repo uses: actions/checkout@v3 @@ -40,12 +51,12 @@ jobs: with: registry: docker.pkg.github.com username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} + password: ${{ secrets.GITHUB_TOKEN }} - - name: Build and push Docker image + - name: Build and push Docker image (tagged) uses: docker/build-push-action@v4 with: context: . push: true - tags: "ghcr.io/ggerganov/llama.cpp:${{ matrix.config.tag }}" + tags: "ghcr.io/ggerganov/llama.cpp:{{ matrix.config.tag }}{{ matrix.config.include_hash && '-{{ env.COMMIT_SHA }}' || '' }}" file: ${{ matrix.config.dockerfile }}