ci: add a stage to deploy to gitlab machines

This commit is contained in:
silver 2023-08-06 18:45:03 +01:00
parent 646a21f098
commit 0315320074

View file

@ -76,7 +76,6 @@ deploy:
- nix --experimental-features 'nix-command flakes' run nixpkgs#colmena -- apply --on @active-dns
- nix --experimental-features 'nix-command flakes' run nixpkgs#colmena -- apply --on @active-core
- nix --experimental-features 'nix-command flakes' run nixpkgs#colmena -- apply --on @active
- nix --experimental-features 'nix-command flakes' run nixpkgs#colmena -- apply --on wheatly
only:
refs:
- main
@ -85,4 +84,23 @@ deploy:
- machines/**/*
- secrets/**/*
- flake.*
- .gitlab-ci.yml
- .gitlab-ci.yml
deploy_gitlab:
stage: deploy
needs:
- deploy
tags:
- nix
before_script:
# setup ssh key
- eval $(ssh-agent -s)
- echo "$DEPLOY_KEY" | tr -d '\r' | ssh-add - > /dev/null
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
# load nix environment
- . "$HOME/.nix-profile/etc/profile.d/nix.sh"
- git pull origin main
script:
- nix --experimental-features 'nix-command flakes' run nixpkgs#colmena -- apply --on @active-gitlab
when: manual