From 4941df7f3bcb600c814d3287197ad807ac3c3576 Mon Sep 17 00:00:00 2001 From: Bernat Vadell Date: Thu, 16 Mar 2023 12:00:05 +0100 Subject: [PATCH] fix github action docker --- .github/workflows/docker.yml | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index b1c7098f6..5dd072211 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -24,18 +24,8 @@ jobs: strategy: matrix: config: - - { tag: "latest", dockerfile: ".devops/main.Dockerfile" } + - { tag: "light", 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 @@ -49,14 +39,23 @@ jobs: - name: Log in to Docker Hub uses: docker/login-action@v2 with: - registry: docker.pkg.github.com + registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + - name: Build and push Docker image (versioned) + if: github.event_name == 'push' + uses: docker/build-push-action@v4 + with: + context: . + push: true + tags: "ghcr.io/ggerganov/llama.cpp:${{ matrix.config.tag }}-${{ env.COMMIT_SHA }}" + file: ${{ matrix.config.dockerfile }} + - 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 }}{{ matrix.config.include_hash && '-{{ env.COMMIT_SHA }}' || '' }}" - file: ${{ matrix.config.dockerfile }} + push: github.event_name == 'push' + tags: "ghcr.io/ggerganov/llama.cpp:${{ matrix.config.tag }}" + file: ${{ matrix.config.dockerfile }} \ No newline at end of file