no checkout when no commit hash

This commit is contained in:
2025-11-29 22:12:23 -05:00
parent 29671e1c1c
commit 72a3ce7906
3 changed files with 2 additions and 11 deletions

View File

@@ -7,7 +7,7 @@ import { rebuildCaddyfile } from "./caddy";
type DeployInstance = {
host: string;
commitHash: string;
commitHash?: string;
};
export const deploy = async ({ host, commitHash }: DeployInstance) => {
@@ -29,7 +29,7 @@ export const deploy = async ({ host, commitHash }: DeployInstance) => {
$.cwd(path.join(serviceDir, "src"));
await $`git fetch origin ${branch}`;
await $`git reset --hard origin/${branch}`;
await $`git checkout ${commitHash}`;
commitHash && (await $`git checkout ${commitHash}`);
// Build
await $`make build`;

View File

@@ -2,5 +2,4 @@ import { deploy } from "../deploy";
await deploy({
host: "deployer2",
commitHash: "",
});