From ee91ae6503beedd4a31ba90e09cbfb4f3924ca7f Mon Sep 17 00:00:00 2001 From: josufh Date: Sun, 7 Jun 2026 19:18:47 +0900 Subject: [PATCH] Harden deployment workflow --- .gitea/workflows/deploy.yml | 9 ++++++++- Dockerfile | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index 7cef5be..79c2b26 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -36,7 +36,14 @@ jobs: ssh-keyscan -p "$DEPLOY_PORT" "$DEPLOY_HOST" >> ~/.ssh/known_hosts - ssh -i ~/.ssh/deploy_key -p "$DEPLOY_PORT" "$DEPLOY_USER@$DEPLOY_HOST" << EOF + ssh \ + -o BatchMode=yes \ + -o ConnectTimeout=20 \ + -o ServerAliveInterval=15 \ + -o ServerAliveCountMax=2 \ + -i ~/.ssh/deploy_key \ + -p "$DEPLOY_PORT" \ + "$DEPLOY_USER@$DEPLOY_HOST" << EOF set -eu if [ ! -d "$DEPLOY_PATH/.git" ]; then diff --git a/Dockerfile b/Dockerfile index 130c6d5..eaa4db4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,7 +5,7 @@ COPY ./*.csproj ./ RUN dotnet restore COPY . ./ -RUN dotnet publish -c Release -o /app/publish --no-restore +RUN dotnet publish LowLevelGuyCom.csproj -c Release -o /app/publish --no-restore FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS runtime