Some checks are pending
Activate NixOS Homelab Configuration On Push / deploy (push) Has started running
31 lines
No EOL
779 B
YAML
31 lines
No EOL
779 B
YAML
name: Activate NixOS Homelab Configuration On Push
|
|
on:
|
|
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 |