diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9674d3b --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +/.idea/.gitignore +/.idea/misc.xml +/.idea/modules.xml +/.idea/rsync-deploy.iml +/.idea/vcs.xml diff --git a/Dockerfile b/Dockerfile index afb6fb5..85405dd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,20 +1,17 @@ -FROM debian:9.5-slim +FROM ubuntu:24.04 -RUN apt update -RUN apt -yq install rsync openssh-client +SHELL ["/bin/bash", "-o", "pipefail", "-c"] +RUN apt-get update \ + && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ + rsync openssh-client \ + && rm -rf /var/lib/apt/lists/* -# Label -LABEL "com.github.actions.name"="Deploy with rsync" -LABEL "com.github.actions.description"="Deploy to a remote server using rsync over ssh" -LABEL "com.github.actions.color"="green" -LABEL "com.github.actions.icon"="truck" - -LABEL "repository"="http://github.com/AEnterprise/rsync-deploy" -LABEL "homepage"="https://github.com/AEnterprise/rsync-deploy" -LABEL "maintainer"="AEnterprise " - +# Labels +LABEL "com.github.actions.name"="Deploy with rsync" \ + "maintainer"="Obinna Odirionye " \ + "org.opencontainers.image.description"="GitHub Action: deploy via rsync" ADD entrypoint.sh /entrypoint.sh RUN chmod +x /entrypoint.sh -ENTRYPOINT ["/entrypoint.sh"] \ No newline at end of file +ENTRYPOINT ["/entrypoint.sh"] diff --git a/README.md b/README.md index 6b35d70..14f1986 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ Deploy to a remote server using rsync. example usage to sync everything in the workspace folder: ``` - name: deploy to server - uses: AEnterprise/rsync-deploy@v1.0 + uses: Phillips-Cohen-Associates-Ltd/rsync-deploy@v2 env: DEPLOY_KEY: ${{ secrets.SERVER_SSH_KEY }} ARGS: "-e -c -r --delete" diff --git a/entrypoint.sh b/entrypoint.sh index 8052c71..a4f44c8 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,10 +1,14 @@ #!/bin/bash -set -eu SSHPATH="$HOME/.ssh" + mkdir -p "$SSHPATH" + echo "$DEPLOY_KEY" > "$SSHPATH/key" + chmod 600 "$SSHPATH/key" + SERVER_DEPLOY_STRING="$USERNAME@$SERVER_IP:$SERVER_DESTINATION" + # sync it up" sh -c "rsync $ARGS -e 'ssh -i $SSHPATH/key -o StrictHostKeyChecking=no -p $SERVER_PORT' $GITHUB_WORKSPACE/$FOLDER $SERVER_DEPLOY_STRING"