Pushing with skopeo

This commit is contained in:
Nicolas Patry 2025-03-18 12:30:49 +01:00
parent 9dc8b67a6f
commit cf3a6cc241
No known key found for this signature in database
GPG Key ID: 4242CEF24CB6DBF9

View File

@ -1,15 +1,10 @@
name: "Nix Build Docker image" name: "Nix Build Docker image"
on: on:
pull_request: push:
# paths: branches:
# - ".github/workflows/nix_build.yaml" - 'main'
# - "server/**" tags:
# - "proto/**" - 'v*'
# - "router/**"
# - "launcher/**"
# - "nix/**"
# - "Cargo.lock"
# - "rust-toolchain.toml"
concurrency: concurrency:
group: nix-image-${{ github.workflow }}-${{ github.head_ref || github.run_id }} group: nix-image-${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true cancel-in-progress: true
@ -37,6 +32,8 @@ jobs:
with: with:
install: true install: true
buildkitd-config: /tmp/buildkitd.toml buildkitd-config: /tmp/buildkitd.toml
- name: Inject slug/short variables
uses: rlespinasse/github-slug-action@v4.4.1
- name: Login to internal Container Registry - name: Login to internal Container Registry
# if: github.event_name != 'pull_request' # if: github.event_name != 'pull_request'
uses: docker/login-action@v3 uses: docker/login-action@v3
@ -46,6 +43,7 @@ jobs:
registry: registry.internal.huggingface.tech registry: registry.internal.huggingface.tech
- name: Push to docker - name: Push to docker
run: | run: |
docker load < ./result export TAG=nix-sha-${{ env.GITHUB_SHA_SHORT }}
docker tag tgi-docker registry.internal.huggingface.tech/api-inference/community/text-generation-inference:nix-test export IMAGE=registry.internal.huggingface.tech/api-inference/community/text-generation-inference:$TAG
docker push registry.internal.huggingface.tech/api-inference/community/text-generation-inference:nix-test 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