39 lines
1.1 KiB
YAML
39 lines
1.1 KiB
YAML
---
|
|
kind: secret
|
|
name: docker_username
|
|
get:
|
|
path: docker
|
|
name: username
|
|
---
|
|
kind: secret
|
|
name: docker_password
|
|
get:
|
|
path: docker
|
|
name: password
|
|
---
|
|
kind: pipeline
|
|
type: kubernetes
|
|
name: publish
|
|
steps:
|
|
- name: build
|
|
image: docker.io/jcollie/nixos-runner:latest
|
|
pull: always
|
|
commands:
|
|
- nix build .#nixos-runner
|
|
- nix run .#push-container -- result
|
|
- podman load --input result | sed -n -e "s/Loaded image:.\\(.*\\)/\\1/p" > loaded-image
|
|
- cat loaded-image
|
|
- podman images
|
|
- podman tag "$(<loaded-image)" "${REGISTRY}/${REPOSITORY}:${GITHUB_RUN_NUMBER}-${GITHUB_SHA:0:8}"
|
|
- podman tag "$(<loaded-image)" "${REGISTRY}/${REPOSITORY}:latest"
|
|
- podman images
|
|
- podman push "${REGISTRY}/${REPOSITORY}:${GITHUB_RUN_NUMBER}-${GITHUB_SHA:0:8}"
|
|
- podman push "${REGISTRY}/${REPOSITORY}:latest"
|
|
- podman logout "${REGISTRY}"
|
|
settings:
|
|
registry: docker.io
|
|
repository: jcollie/nixos-runner
|
|
username:
|
|
from_secret: docker_username
|
|
password:
|
|
from_secret: docker_password
|