From 22a90824ff5798b46b27225500bb190bdaf38787 Mon Sep 17 00:00:00 2001 From: Clemens Hering Date: Sun, 9 Nov 2025 17:47:13 +0100 Subject: [PATCH] test local clone --- .gitea/workflows/deploy.yaml | 44 +++++------------------------------- 1 file changed, 6 insertions(+), 38 deletions(-) diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml index cfce786..2734ee1 100644 --- a/.gitea/workflows/deploy.yaml +++ b/.gitea/workflows/deploy.yaml @@ -38,7 +38,7 @@ jobs: git config --global --unset-all core.sshCommand || true echo "Global git config after:" || true git config --global --list || true - - name: Setup SSH for git/scp/rsync + - name: Setup SSH for git/scp shell: bash run: | install -m 700 -d ~/.ssh @@ -52,46 +52,14 @@ jobs: - name: Checkout Repository uses: actions/checkout@v4 - - name: Deploy via SSH (only required files) + - name: Copy entire repository to target host shell: bash run: | - # Ensure target dir exists + # Create target directory and stream full repo via tar over ssh (includes .git) ssh $TARGET_USER@$TARGET_HOST "mkdir -p $APP_DIR" - - # If rsync available both locally and remotely, use it with include/exclude for minimal sync - if command -v rsync >/dev/null 2>&1 && ssh $TARGET_USER@$TARGET_HOST 'command -v rsync >/dev/null 2>&1'; then - rsync -az --delete \ - --prune-empty-dirs \ - --include '/astro.config.mjs' \ - --include '/package.json' \ - --include '/package-lock.json' \ - --include '/postcss.config.js' \ - --include '/tailwind.config.js' \ - --include '/server.mjs' \ - --include '/Containerfile' \ - --include '/public/***' \ - --include '/src/***' \ - --exclude '/.git/***' \ - --exclude '/.gitea/***' \ - --exclude '/deploy/***' \ - --exclude '/node_modules/***' \ - --exclude '/dist/***' \ - --exclude '*' \ - ./ $TARGET_USER@$TARGET_HOST:$APP_DIR/ - else - echo "rsync not available, using tar-over-ssh fallback with minimal set" - tar -czf - \ - astro.config.mjs \ - package.json \ - package-lock.json \ - postcss.config.js \ - tailwind.config.js \ - server.mjs \ - Containerfile \ - public \ - src \ - | ssh $TARGET_USER@$TARGET_HOST "tar -xzf - -C $APP_DIR" - fi + 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" - name: Build container on target host run: |