switch CI deploy to local nixos-rebuild instead of deploy-rs over SSH
Runner runs on the same server it deploys to, so SSH to itself was unnecessarily complex. Now builds locally and activates directly. - Replace deploy-rs SSH workflow with local build + switch - Add NOPASSWD sudo for gitea-runner to run nix-env and switch-to-configuration (required for local deployment) - Remove SSH key setup from deploy workflow
This commit is contained in:
parent
4ef5199810
commit
e2e87d5694
2 changed files with 10 additions and 11 deletions
|
|
@ -22,18 +22,11 @@ jobs:
|
|||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up SSH
|
||||
env:
|
||||
DEPLOY_KEY: ${{ secrets.DEPLOY_SSH_KEY }}
|
||||
run: |
|
||||
mkdir -p ~/.ssh
|
||||
echo "$DEPLOY_KEY" > ~/.ssh/id_ed25519
|
||||
chmod 600 ~/.ssh/id_ed25519
|
||||
ssh-keyscan -p 2299 -H cryodev.xyz >> ~/.ssh/known_hosts
|
||||
chmod 644 ~/.ssh/known_hosts
|
||||
- name: Build system configuration
|
||||
run: nix build .#nixosConfigurations.cryodev-main.config.system.build.toplevel --out-link result
|
||||
|
||||
- name: Deploy with deploy-rs
|
||||
run: NIX_SSHOPTS="-p 2299 -o StrictHostKeyChecking=accept-new" nix run github:serokell/deploy-rs -- -s .#cryodev-main
|
||||
- name: Deploy locally
|
||||
run: sudo nix-env -p /nix/var/nix/profiles/system --set $(readlink -f result) && sudo result/bin/switch-to-configuration switch
|
||||
|
||||
build-pi-images:
|
||||
needs: flake-check
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue