From cf3a6cc24177bc496bb90c28c30312030b14992b Mon Sep 17 00:00:00 2001 From: Nicolas Patry Date: Tue, 18 Mar 2025 12:30:49 +0100 Subject: [PATCH] Pushing with skopeo --- .github/workflows/nix_build.yaml | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/.github/workflows/nix_build.yaml b/.github/workflows/nix_build.yaml index a05dac10..f8fbf9aa 100644 --- a/.github/workflows/nix_build.yaml +++ b/.github/workflows/nix_build.yaml @@ -1,15 +1,10 @@ name: "Nix Build Docker image" on: - pull_request: - # paths: - # - ".github/workflows/nix_build.yaml" - # - "server/**" - # - "proto/**" - # - "router/**" - # - "launcher/**" - # - "nix/**" - # - "Cargo.lock" - # - "rust-toolchain.toml" + push: + branches: + - 'main' + tags: + - 'v*' concurrency: group: nix-image-${{ github.workflow }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true @@ -37,6 +32,8 @@ jobs: with: install: true buildkitd-config: /tmp/buildkitd.toml + - name: Inject slug/short variables + uses: rlespinasse/github-slug-action@v4.4.1 - name: Login to internal Container Registry # if: github.event_name != 'pull_request' uses: docker/login-action@v3 @@ -46,6 +43,7 @@ jobs: registry: registry.internal.huggingface.tech - name: Push to docker run: | - docker load < ./result - docker tag tgi-docker registry.internal.huggingface.tech/api-inference/community/text-generation-inference:nix-test - docker push registry.internal.huggingface.tech/api-inference/community/text-generation-inference:nix-test + export TAG=nix-sha-${{ env.GITHUB_SHA_SHORT }} + export IMAGE=registry.internal.huggingface.tech/api-inference/community/text-generation-inference:$TAG + nix-shell -p skopeo + skopeo --insecure-policy copy docker-archive:$(readlink -f ./result) docker://registry.internal.huggingface.tech/api-inference/community/text-generation-inference:nix-docker-test6 --dest-compress-format zstd