From 12db8cc6b4d89e421ea20cbd41e0d05e6abbd12c Mon Sep 17 00:00:00 2001 From: maulanasdqn Date: Thu, 2 Apr 2026 22:44:10 +0700 Subject: [PATCH] ci: fix SSH pipe drop on long nixos-rebuild, add workflow_dispatch - Add ServerAliveInterval=30/ServerAliveCountMax=40 to prevent broken pipe during nixos-rebuild switch (up to 20min keepalive) - Remove continue-on-error so deploy failures are visible - Add workflow_dispatch trigger for manual reruns Co-Authored-By: Claude Sonnet 4.6 --- .github/workflows/nix-build.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/nix-build.yml b/.github/workflows/nix-build.yml index 83c6e1a..d1ee591 100644 --- a/.github/workflows/nix-build.yml +++ b/.github/workflows/nix-build.yml @@ -5,6 +5,7 @@ on: branches: ['develop'] pull_request: branches: ['develop'] + workflow_dispatch: jobs: build: @@ -63,10 +64,14 @@ jobs: fi - name: Deploy to server - continue-on-error: true run: | - ssh -i ~/.ssh/deploy_key -o ConnectTimeout=15 -o StrictHostKeyChecking=accept-new root@167.235.70.37 \ - 'nixos-rebuild switch --flake github:IMPHNEN/imphnen-infrastructure#hetzner --refresh 2>&1 | tail -30' + ssh -i ~/.ssh/deploy_key \ + -o ConnectTimeout=30 \ + -o StrictHostKeyChecking=accept-new \ + -o ServerAliveInterval=30 \ + -o ServerAliveCountMax=40 \ + root@167.235.70.37 \ + 'nixos-rebuild switch --flake github:IMPHNEN/imphnen-infrastructure#hetzner --refresh 2>&1 | tail -50' - name: Cleanup if: always()