From 21973975f43826e5b8d3464acb3712431ef104f7 Mon Sep 17 00:00:00 2001 From: lubiana Date: Thu, 12 Dec 2024 02:25:31 +0100 Subject: [PATCH] init --- Dockerfile | 2 +- README.md | 2 +- entrypoint.sh | 6 ++++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2bf8a4a..3a2f97b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,6 +5,6 @@ RUN apk add --no-cache \ rsync COPY entrypoint.sh /entrypoint.sh -RUN chmod +x /entrypoints.sh +RUN chmod +x /entrypoint.sh ENTRYPOINT ["/entrypoint.sh"] diff --git a/README.md b/README.md index 85d1846..197169f 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ jobs: - name: rsync uses: https://git.hannover.ccc.de/c3h/actions-rsync-deployment@v1 with: - switches: -avz --delete + rsync_parameters: -avz --delete path: public/ remote_path: /home/web/public remote_host: example.com diff --git a/entrypoint.sh b/entrypoint.sh index 1f3090f..66a0b50 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,3 +1,5 @@ +#!/bin/sh -l + mkdir -p ~/.ssh/ # Print the SSH key, replacing newline characters with actual new lines @@ -7,9 +9,9 @@ echo "$INPUT_REMOTE_KEY" | tr -d '\r' > ~/.ssh/id_rsa chmod 600 ~/.ssh/id_rsa # Add the remote host's key to the known_hosts file to avoid authenticity confirmation -ssh-keyscan -H $INPUT_REMOTE_HOST >> ~/.ssh/known_hosts +ssh-keyscan -H ${INPUT_REMOTE_HOST} >> ~/.ssh/known_hosts # SCP files to the remote host -rsync ${INPUT_RSYNC_PARAMETERS} public/ ${INPUT_REMOTE_USER}@${INPUT_REMOTE_HOST}:${INPUT_REMOTE_PATH} +rsync ${INPUT_RSYNC_PARAMETERS} ${INPUT_PATH} ${INPUT_REMOTE_USER}@${INPUT_REMOTE_HOST}:${INPUT_REMOTE_PATH} exit 0