Files
nixos/.gitlab-ci.yml
T

62 lines
1.1 KiB
YAML

stages:
- eval
- build
- push
default:
tags:
- nix
"Evaluate for builds":
stage: eval
artifacts:
paths:
- gitlab-ci-continue.yml
script: nix run ".#gen-build" > gitlab-ci-continue.yml
"Trigger builds":
stage: build
trigger:
include:
- artifact: gitlab-ci-continue.yml
job: "Evaluate for builds"
variables:
PARENT_PIPELINE_ID: $CI_PIPELINE_ID
"Build image":
stage: build
parallel: &parallel
matrix:
- IMG:
- img-bitwarden
- img-immich
artifacts:
paths:
- "*.tar.gz"
script:
- nix build ".#${IMG}"
- cp -L result "${IMG}.tar.gz"
"Push Image":
stage: push
parallel: *parallel
dependencies:
- "Build image"
image: "quay.io/podman/stable"
services:
- "docker:28-dind"
tags:
- kubernetes
script:
- >-
podman login
-u "$CI_REGISTRY_USER"
-p "$CI_REGISTRY_PASSWORD"
"$CI_REGISTRY"
- podman load -i "${IMG}.tar.gz"
- >-
podman tag
"localhost/${IMG}:latest"
"$CI_REGISTRY/greg/nixos-config/${IMG}:latest"
- podman push "$CI_REGISTRY/greg/nixos-config/${IMG}:latest"