nix-flake/.forgejo/workflows/activate.yml
Satria 79aed28d47
Some checks failed
Activate NixOS Homelab Configuration On Push / deploy (push) Has been cancelled
add manual trigger
2026-03-14 11:35:16 +07:00

32 lines
No EOL
800 B
YAML

name: Activate NixOS Homelab Configuration On Push
on:
workflow_dispatch:
push:
branches:
- main
env:
PATH: /run/current-system/sw/bin:/run/wrappers/bin
jobs:
deploy:
runs-on: nixos-server
defaults:
run:
shell: /bin/sh -e {0}
steps:
- name: Clone Repository
run: |
rm -rf src
git clone https://git.satr14.my.id/satr14/nix-flake.git src
- name: Setup SSH Key
run: |
mkdir -p ~/.ssh
echo "${{ secrets.DEPLOY_SSH_KEY }}" > ~/.ssh/id_ed25519
chmod 600 ~/.ssh/id_ed25519
ssh-keyscan -H localhost >> ~/.ssh/known_hosts
- name: Deploy System over SSH
run: nixos-rebuild switch --flake ./src#homelab --target-host root@localhost -L --show-trace