Archive Legacy Setup And Add Ansible Control Plane
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
name: NixOS switch mini-pc
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
paths:
|
||||
- ".gitea/workflows/nixos-switch-mini-pc.yml"
|
||||
- "nixos/flake.nix"
|
||||
- "nixos/flake.lock"
|
||||
- "nixos/modules/**"
|
||||
- "nixos/hosts/mini-pc/**"
|
||||
|
||||
jobs:
|
||||
switch:
|
||||
runs-on: mini-pc
|
||||
steps:
|
||||
- name: Sync repo
|
||||
run: |
|
||||
git config --global --replace-all safe.directory /opt/services
|
||||
git -C /opt/services pull origin main --ff-only
|
||||
chown -R 1000:100 /opt/services
|
||||
|
||||
- name: Switch NixOS generation
|
||||
env:
|
||||
NIXOS_DEPLOY_KEY: ${{ secrets.NIXOS_DEPLOY_KEY }}
|
||||
run: |
|
||||
KEY=$(mktemp)
|
||||
echo "$NIXOS_DEPLOY_KEY" > "$KEY"
|
||||
chmod 600 "$KEY"
|
||||
trap "rm -f $KEY" EXIT
|
||||
ssh -i "$KEY" -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \
|
||||
ada@192.168.1.10 \
|
||||
"sudo /run/current-system/sw/bin/nixos-rebuild switch --flake /opt/services/nixos#mini-pc"
|
||||
Reference in New Issue
Block a user