nix-flake/.forgejo/workflows/activate.yml
Satria 50c5788e6b
Some checks failed
NixOS Rebuild / rebuild (push) Failing after 0s
uses ssh instead
2026-03-15 09:49:32 +07:00

31 lines
No EOL
809 B
YAML

name: NixOS Rebuild
on:
push:
branches: [ main ]
workflow_dispatch:
jobs:
rebuild:
runs-on: self-hosted
steps:
- name: Setup SSH key
run: |
mkdir -p ./ssh
echo "${{ secrets.DEPLOY_SSH_KEY }}" > ./ssh/deploy_key
chmod 600 ./ssh/deploy_key
echo "StrictHostKeyChecking no" > ./ssh/config
- name: Rebuild (${{ github.event.inputs.action || 'switch' }})
run: |
ssh -i ./ssh/deploy_key root@localhost \
"nixos-rebuild switch \
--flake git+http://localhost:5080/satr14/nix-flake#homelab -L"
- name: Show generation
if: always()
run: ssh -i ./ssh/deploy_key root@localhost "nixos-version"
- name: Clean Up
if: always()
run: rm -f ./ssh/deploy_key