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"
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