diff --git a/justfile b/justfile index 4d5f8a6..42dc853 100644 --- a/justfile +++ b/justfile @@ -33,7 +33,10 @@ api-test: dotnet test {{api_solution}} api-publish: - dotnet publish {{api_project}} -c Release + dotnet publish {{api_project}} -c Release -o {{root_dir}}/api/publish + +deploy-new-version: + {{root_dir}}/scripts/deploy-api.sh ui-install: cd {{ui_dir}} && bun install diff --git a/scripts/deploy-api.sh b/scripts/deploy-api.sh new file mode 100644 index 0000000..cb6fc33 --- /dev/null +++ b/scripts/deploy-api.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash +set -euo pipefail + +REPO_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" + +echo "==> Pulling latest changes..." +git -C "$REPO_DIR" pull + +echo "==> Publishing API..." +dotnet publish "$REPO_DIR/api/App/App.csproj" \ + -c Release \ + -o "$REPO_DIR/api/publish" + +echo "==> Restarting service..." +sudo systemctl restart klapi-api + +echo "==> Done."