From 39e82c8496382ed9e84cebe7958e961549e1a0d2 Mon Sep 17 00:00:00 2001 From: div72 Date: Mon, 16 Sep 2024 13:02:56 +0300 Subject: [PATCH] build.deploy: push with --force-with-lease Rebases on non-main branches require a manual push otherwise, the main branch should still be protected due to the checks above. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 7d83566..51839c9 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,7 @@ deploy: @# Check if current branch is rebased to main. This can cause a rollback of changes otherwise. @git branch --contains $$(git log --format=format:%H -1 main) | grep -q $$(git rev-parse --abbrev-ref HEAD) \ || (echo "ERROR: Branch is not rebased to master, please rebase." && exit 1) - git push server + git push --force-with-lease server @# Agent forwarding allows using sudo using the local agent. ssh -tt -A $(USER)@ozguryazilimhacettepe.com "cd /etc/nixos && git checkout $$(git rev-parse --abbrev-ref HEAD) && sudo nixos-rebuild switch"