2024-04-12 10:50:05 +00:00
|
|
|
labels:
|
|
|
|
hostname: "nixos-x86-64"
|
|
|
|
|
|
|
|
variables: &nix-config
|
|
|
|
NIXOS_VERSION: "unstable"
|
|
|
|
NIXPKGS_ALLOW_UNFREE: "1"
|
|
|
|
NIXPKGS_ALLOW_INSECURE: "1"
|
|
|
|
|
|
|
|
steps:
|
2024-05-20 14:08:10 +00:00
|
|
|
- name: Check Flake
|
2024-05-20 16:15:06 +00:00
|
|
|
image: nixlocal
|
2024-05-20 14:57:06 +00:00
|
|
|
entrypoint: ["/bin/sh", "-c"]
|
2024-04-12 10:50:05 +00:00
|
|
|
commands:
|
|
|
|
- nix-channel --add https://nixos.org/channels/nixos-$${NIXOS_VERSION} nixos
|
|
|
|
- nix-channel --update
|
|
|
|
- nix flake check
|
|
|
|
environment:
|
|
|
|
*nix-config
|
|
|
|
when:
|
|
|
|
- evaluate: 'CI_PIPELINE_EVENT != "cron" && CI_PIPELINE_EVENT != "schedule"'
|
|
|
|
|
|
|
|
- name: Deploy
|
2024-05-20 16:15:06 +00:00
|
|
|
image: nixlocal
|
2024-04-12 10:50:05 +00:00
|
|
|
commands:
|
2024-05-20 14:08:10 +00:00
|
|
|
- nix-env -iA nixos.openssh
|
|
|
|
- eval "$(ssh-agent -s)"
|
|
|
|
- echo $${SSH_PRIVATE_KEY}} | ssh-add -
|
2024-04-12 10:50:05 +00:00
|
|
|
- nix develop --command deploy
|
|
|
|
environment:
|
|
|
|
*nix-config
|
|
|
|
when:
|
|
|
|
- evaluate: 'CI_PIPELINE_EVENT != "cron" && CI_COMMIT_BRANCH == "master"'
|
|
|
|
|