Add Gitea deploy and NixOS switch workflows
Deploy cloud-pc / deploy (push) Failing after 1s
Deploy mini-pc / deploy (push) Failing after 4s
NixOS switch mini-pc / switch (push) Failing after 10m19s
NixOS switch cloud-pc / switch (push) Has been cancelled

This commit is contained in:
Dmitry
2026-05-29 17:17:27 +03:00
parent 0f6c4525b2
commit 86fb248d85
7 changed files with 113 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
name: Deploy cloud-pc
on:
workflow_dispatch:
inputs:
stack:
description: "Stack to deploy (leave empty to reconcile all)"
required: false
push:
paths:
- ".gitea/workflows/deploy-cloud-pc.yml"
- "cloud-pc/**"
- "scripts/deploy.sh"
schedule:
- cron: "0 4 * * *"
jobs:
deploy:
runs-on: cloud-pc
steps:
- name: Sync repo
run: |
git config --global --replace-all safe.directory /opt/services
git -C /opt/services pull --ff-only
- name: Deploy stacks
run: /opt/services/scripts/deploy.sh cloud-pc "${{ inputs.stack }}"
+27
View File
@@ -0,0 +1,27 @@
name: Deploy mini-pc
on:
workflow_dispatch:
inputs:
stack:
description: "Stack to deploy (leave empty to reconcile all)"
required: false
push:
paths:
- ".gitea/workflows/deploy-mini-pc.yml"
- "mini-pc/**"
- "scripts/deploy.sh"
schedule:
- cron: "0 4 * * *"
jobs:
deploy:
runs-on: mini-pc
steps:
- name: Sync repo
run: |
git config --global --replace-all safe.directory /opt/services
git -C /opt/services pull --ff-only
- name: Deploy stacks
run: /opt/services/scripts/deploy.sh mini-pc "${{ inputs.stack }}"
@@ -0,0 +1,20 @@
name: NixOS switch cloud-pc
on:
workflow_dispatch:
push:
paths:
- ".gitea/workflows/nixos-switch-cloud-pc.yml"
- "nixos/**"
jobs:
switch:
runs-on: cloud-pc-nixos
steps:
- name: Sync repo
run: |
git config --global --replace-all safe.directory /opt/services
git -C /opt/services pull --ff-only
- name: Switch NixOS generation
run: sudo /run/current-system/sw/bin/nixos-rebuild switch --flake /opt/services/nixos#cloud-pc
+20
View File
@@ -0,0 +1,20 @@
name: NixOS switch mini-pc
on:
workflow_dispatch:
push:
paths:
- ".gitea/workflows/nixos-switch-mini-pc.yml"
- "nixos/**"
jobs:
switch:
runs-on: mini-pc-nixos
steps:
- name: Sync repo
run: |
git config --global --replace-all safe.directory /opt/services
git -C /opt/services pull --ff-only
- name: Switch NixOS generation
run: sudo /run/current-system/sw/bin/nixos-rebuild switch --flake /opt/services/nixos#mini-pc
+2
View File
@@ -33,6 +33,8 @@
};
};
services.resolved.enable = false;
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
+12
View File
@@ -37,6 +37,18 @@
};
};
security.sudo.extraRules = [
{
users = [ "ada" ];
commands = [
{
command = "/run/current-system/sw/bin/nixos-rebuild";
options = [ "NOPASSWD" ];
}
];
}
];
environment.systemPackages = with pkgs; [
git
restic
+5
View File
@@ -47,6 +47,11 @@ for dir in $dirs; do
continue
fi
if { [ "$HOST" = "cloud-pc" ] || [ "$HOST" = "mini-pc" ]; } && [ "$dir" = "zerotier" ]; then
echo "Skipping zerotier (managed by NixOS service)"
continue
fi
stack_dir="$BASE/$HOST/$dir"
cd "$stack_dir"