Build and push together

This commit is contained in:
Greg Hellings
2025-11-25 16:38:56 -06:00
parent 31ecf32bf9
commit 9d006a1768
+8 -19
View File
@@ -25,37 +25,26 @@ default:
"Build image": "Build image":
stage: build stage: build
tags:
- kubernetes
image: "nixos/nix:latest"
parallel: &parallel parallel: &parallel
matrix: matrix:
- IMG: - IMG:
- img-bitwarden - img-bitwarden
- img-immich - img-immich
artifacts:
paths:
- "*.tar.gz"
script: script:
- nix build ".#${IMG}" - nix build ".#${IMG}"
- cp -L result "${IMG}.tar.gz" - cp -L result "${IMG}.tar.gz"
- nix build "nixpkgs#podman" --out-link podman
"Push Image":
stage: push
parallel: *parallel
dependencies:
- "Build image"
image: "quay.io/podman/stable"
services:
- "docker:28-dind"
tags:
- kubernetes
script:
- >- - >-
podman login ./podman/bin/podman login
-u "$CI_REGISTRY_USER" -u "$CI_REGISTRY_USER"
-p "$CI_REGISTRY_PASSWORD" -p "$CI_REGISTRY_PASSWORD"
"$CI_REGISTRY" "$CI_REGISTRY"
- podman load -i "${IMG}.tar.gz" - ./podman/bin/podman load -i "${IMG}.tar.gz"
- >- - >-
podman tag ./podman/bin/podman tag
"localhost/${IMG}:latest" "localhost/${IMG}:latest"
"$CI_REGISTRY/greg/nixos-config/${IMG}:latest" "$CI_REGISTRY/greg/nixos-config/${IMG}:latest"
- podman push "$CI_REGISTRY/greg/nixos-config/${IMG}:latest" - ./podman/bin/podman push "$CI_REGISTRY/greg/nixos-config/${IMG}:latest"