init
This commit is contained in:
parent
4a197eed1d
commit
21973975f4
3 changed files with 6 additions and 4 deletions
|
@ -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"]
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue