36 lines
885 B
YAML
36 lines
885 B
YAML
labels:
|
|
hostname: "nixos-x86-64"
|
|
|
|
variables: &nix-config
|
|
NIXOS_VERSION: "unstable"
|
|
NIXPKGS_ALLOW_UNFREE: "1"
|
|
NIXPKGS_ALLOW_INSECURE: "1"
|
|
|
|
steps:
|
|
- name: Check Flake
|
|
image: nixos/nix:latest
|
|
pull: true
|
|
entrypoint: ["/bin/sh", "-c"]
|
|
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
|
|
image: nixos/nix:latest
|
|
pull: true
|
|
commands:
|
|
- nix-env -iA nixos.openssh
|
|
- eval "$(ssh-agent -s)"
|
|
- echo $${SSH_PRIVATE_KEY}} | ssh-add -
|
|
- nix develop --command deploy
|
|
environment:
|
|
*nix-config
|
|
when:
|
|
- evaluate: 'CI_PIPELINE_EVENT != "cron" && CI_COMMIT_BRANCH == "master"'
|
|
|