test local clone
Some checks failed
Build and Deploy Container / build_and_deploy (push) Has been cancelled
Some checks failed
Build and Deploy Container / build_and_deploy (push) Has been cancelled
This commit is contained in:
@@ -18,19 +18,29 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
build_and_deploy:
|
build_and_deploy:
|
||||||
runs-on: linux
|
runs-on: linux
|
||||||
container:
|
|
||||||
image: ubuntu:latest
|
|
||||||
options: --entrypoint /bin/sh
|
|
||||||
steps:
|
steps:
|
||||||
- name: Install tools
|
- name: Setup SSH for git/scp/rsync
|
||||||
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
apt-get update
|
install -m 700 -d ~/.ssh
|
||||||
apt-get install -y bash git openssh-client rsync podman-cli
|
printf "%s\n" "$SSH_PRIVATE_KEY" > ~/.ssh/id_ed25519
|
||||||
|
chmod 600 ~/.ssh/id_ed25519
|
||||||
|
printf "%s\n" "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
|
||||||
|
chmod 644 ~/.ssh/known_hosts
|
||||||
|
git config --global url."ssh://git@gitea.smb-corp.de".insteadOf "https://gitea.smb-corp.de"
|
||||||
|
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
run: git clone git@gitea.smb-corp.de:${{ gitea.repository }} .
|
run: git clone git@gitea.smb-corp.de:${{ gitea.repository }} .
|
||||||
- name: Deploy via SSH
|
- name: Deploy via SSH (rsync or scp fallback)
|
||||||
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
|
if command -v rsync >/dev/null 2>&1; then
|
||||||
rsync -az --delete ./ $TARGET_USER@$TARGET_HOST:$APP_DIR/
|
rsync -az --delete ./ $TARGET_USER@$TARGET_HOST:$APP_DIR/
|
||||||
|
else
|
||||||
|
echo "rsync not found, falling back to scp -r (no delete sync)"
|
||||||
|
ssh $TARGET_USER@$TARGET_HOST "mkdir -p $APP_DIR"
|
||||||
|
scp -r ./ $TARGET_USER@$TARGET_HOST:$APP_DIR/
|
||||||
|
fi
|
||||||
# - name: Checkout repository from local Gitea
|
# - name: Checkout repository from local Gitea
|
||||||
# run: |
|
# run: |
|
||||||
# git clone http://gitea:3000/${{ gitea.repository }} .
|
# git clone http://gitea:3000/${{ gitea.repository }} .
|
||||||
|
|||||||
Reference in New Issue
Block a user