ci: add CI and rename image to nix-coder-image

This commit is contained in:
technofab 2024-04-24 19:06:12 +02:00
parent 7cd71e7537
commit b98a1e728c
3 changed files with 33 additions and 1 deletions

View file

@ -82,6 +82,34 @@
modules = [./nix-kubernetes];
};
};
ci = {
stages = ["build" "upload"];
jobs = {
"build" = {
stage = "build";
script = [
"nix build .#nix-coder-image"
];
after_script = [
"install -D result dist/nix-coder-image.tar.gz"
];
artifacts.paths = ["dist/"];
};
"upload" = {
stage = "upload";
needs = ["build"];
deps = [pkgs.skopeo];
script = [
''
skopeo --insecure-policy copy --dest-creds "''${CI_REGISTRY_USER}:''${CI_REGISTRY_PASSWORD}" --tmpdir /tmp \
"docker-archive:dist/nix-coder-image.tar.gz" \
"docker://''${CI_REGISTRY_IMAGE}/nix-coder-image:''${CI_COMMIT_SHORT_SHA}"
''
];
};
};
};
};
};