@@ -55,7 +55,8 @@ deployPush deployPath = do
5555 , _nixBuildConfig_args = pure $ Arg "hostName" host
5656 }
5757 return $ listToMaybe $ lines $ buildOutput
58− build `finally` packThunk srcPath "origin" -- get upstream
58+ result <- build `finally` packThunk srcPath "origin" -- get upstream
59+ return result
5960 _ -> return Nothing
6061 forM_ result $ \res -> do
6162 callProcess "nix-copy-closure" ["-v", "--to", "root@" <> host, "--gzip", res]
@@ -67,3 +68,7 @@ deployPush deployPath = do
6768 , "/nix/var/nix/profiles/system/bin/switch-to-configuration switch"
6869 ]
6970 ]
71+ isClean <- checkGitCleanStatus deployPath
72+ when (not isClean) $ do
73+ callProcess "git" ["-C", deployPath, "add", "--update"]
74+ callProcess "git" ["-C", deployPath, "commit", "-m", "New deployment"]