This commit is contained in:
Jonas 2024-12-12 02:25:31 +01:00
parent 4a197eed1d
commit 21973975f4
Signed by: lubiana
SSH key fingerprint: SHA256:vW1EA0fRR3Fw+dD/sM0K+x3Il2gSry6YRYHqOeQwrfk
3 changed files with 6 additions and 4 deletions

View file

@ -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"]

View file

@ -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

View file

@ -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