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