test local clone
Some checks failed
Build and Deploy Container / build_and_deploy (push) Failing after 21s
Some checks failed
Build and Deploy Container / build_and_deploy (push) Failing after 21s
This commit is contained in:
@@ -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: |
|
||||
|
||||
Reference in New Issue
Block a user