infrastructure/.woodpecker/deploy.yaml

44 lines
1006 B
YAML
Raw Normal View History

labels:
hostname: "nixos-x86-64"
variables: &nix-config
NIXOS_VERSION: "unstable"
NIXPKGS_ALLOW_UNFREE: "1"
NIXPKGS_ALLOW_INSECURE: "1"
steps:
- name: Configure Nix Channels
image: bash
commands:
- nix-channel --add https://nixos.org/channels/nixos-$${NIXOS_VERSION} nixos
- nix-channel --update
environment:
*nix-config
when:
- evaluate: 'CI_PIPELINE_EVENT != "cron" && CI_PIPELINE_EVENT != "schedule"'
- name: Check Flake
image: bash
commands:
- nix flake check
environment:
*nix-config
when:
- evaluate: 'CI_PIPELINE_EVENT != "cron" && CI_PIPELINE_EVENT != "schedule"'
- name: Place SSH Key
image: bash
commands:
- echo $${SSH_PRIVATE_KEY}} > .privkey
- chmod 0600 .privkey
- name: Deploy
image: bash
commands:
- nix develop --command deploy
environment:
*nix-config
when:
- evaluate: 'CI_PIPELINE_EVENT != "cron" && CI_COMMIT_BRANCH == "master"'