From e6d6d7999ca86503aaf12391839223eb2ee33484 Mon Sep 17 00:00:00 2001 From: Clemens Hering Date: Sun, 9 Nov 2025 17:50:08 +0100 Subject: [PATCH] test local clone --- .gitea/workflows/deploy.yaml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml index 2734ee1..7bc2cc0 100644 --- a/.gitea/workflows/deploy.yaml +++ b/.gitea/workflows/deploy.yaml @@ -52,14 +52,18 @@ jobs: - name: Checkout Repository uses: actions/checkout@v4 - - name: Copy entire repository to target host + - name: Copy entire repository to target host (scp, overwrite) shell: bash run: | - # Create target directory and stream full repo via tar over ssh (includes .git) - ssh $TARGET_USER@$TARGET_HOST "mkdir -p $APP_DIR" - echo "Streaming repository to $TARGET_HOST:$APP_DIR" - # Use pax-compatible tar to preserve permissions; gzip for transfer - tar -czf - . | ssh $TARGET_USER@$TARGET_HOST "tar -xzf - -C $APP_DIR" + set -euo pipefail + # Ensure target directory exists + ssh -o BatchMode=yes -i ~/.ssh/id_ed25519 $TARGET_USER@$TARGET_HOST "mkdir -p $APP_DIR" + echo "Copying repository files to $TARGET_HOST:$APP_DIR via scp (overwrites existing files)" + # Enable dotglob so hidden files are included in the glob + shopt -s dotglob + # Copy all files and directories in the repo root to the remote host + scp -r -o BatchMode=yes -i ~/.ssh/id_ed25519 ./* $TARGET_USER@$TARGET_HOST:$APP_DIR/ + echo "Copy finished" - name: Build container on target host run: |