From 1bbe8382e5855e7f438cf50ab4b9fd37d15f15f7 Mon Sep 17 00:00:00 2001 From: Steven Agyekum Date: Fri, 27 Dec 2019 16:08:00 +0100 Subject: [PATCH 1/7] Update Dockerfile --- Dockerfile | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index fff8dcf..caa4435 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,7 @@ -FROM ubuntu:latest +FROM alpine:latest # Update -RUN apt-get update - -# Install packages -RUN apt-get -yq install rsync openssh-client +RUN apk --update add rsync # Copy entrypoint ADD entrypoint.sh /entrypoint.sh From 20b1f5b4b8dc74188d1220f12ee8fff962e8f439 Mon Sep 17 00:00:00 2001 From: Steven Agyekum Date: Fri, 27 Dec 2019 16:11:54 +0100 Subject: [PATCH 2/7] Update Dockerfile --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index caa4435..529412d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,10 @@ FROM alpine:latest # Update -RUN apk --update add rsync +RUN apk --update add rsync openssh-client # Copy entrypoint ADD entrypoint.sh /entrypoint.sh RUN chmod +x /entrypoint.sh + ENTRYPOINT ["/entrypoint.sh"] From f5c5431bf694f8c410b456be9ea658cd765031bd Mon Sep 17 00:00:00 2001 From: Steven Agyekum Date: Fri, 27 Dec 2019 16:12:10 +0100 Subject: [PATCH 3/7] Update entrypoint.sh --- entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index c321d7d..83ea6d5 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -eu From 6fa9b56771ea5ca7bbf11f6340b0c05ad6058ec2 Mon Sep 17 00:00:00 2001 From: Steven Agyekum Date: Fri, 27 Dec 2019 16:14:47 +0100 Subject: [PATCH 4/7] Update Dockerfile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 529412d..9157dd5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ FROM alpine:latest # Update -RUN apk --update add rsync openssh-client +RUN apk --update --no-cache add rsync bash openssh-client # Copy entrypoint ADD entrypoint.sh /entrypoint.sh From 6a989b68a13e8d029c772158de4318183d3ec58c Mon Sep 17 00:00:00 2001 From: Steven Agyekum Date: Fri, 27 Dec 2019 16:29:01 +0100 Subject: [PATCH 5/7] Update README.md --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index bca2f03..adb40cf 100644 --- a/README.md +++ b/README.md @@ -3,9 +3,11 @@ Forked from [Contention/rsync-deployments](https://github.com/Contention/rsync-deployments) -This GitHub Action deploys files in `GITHUB_WORKSPACE` to a folder on a server via rsync over ssh. +This GitHub Action deploys files in `GITHUB_WORKSPACE` to a remote folder via rsync over ssh. -Use this action in a build/test workflow which leaves deployable code in `GITHUB_WORKSPACE`. +Use this action in a CD workflow which leaves deployable code in `GITHUB_WORKSPACE`. + +The base-image is very small (Alpine+Cache) which results in faster deployments. --- From f8c929a1f4aace0c9b0390e2d6036a1da482fef4 Mon Sep 17 00:00:00 2001 From: Steven Agyekum Date: Fri, 27 Dec 2019 16:33:45 +0100 Subject: [PATCH 6/7] Update README.md --- README.md | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index adb40cf..3e1a840 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ jobs: steps: - uses: actions/checkout@v1 - name: rsync deployments - uses: burnett01/rsync-deployments@2.0 + uses: burnett01/rsync-deployments@3.0 with: switches: -avzr --delete path: src/ @@ -77,7 +77,7 @@ jobs: steps: - uses: actions/checkout@v1 - name: rsync deployments - uses: burnett01/rsync-deployments@2.0 + uses: burnett01/rsync-deployments@3.0 with: switches: -avzr --delete --exclude="" --include="" --filter="" path: src/ @@ -103,7 +103,7 @@ jobs: steps: - uses: actions/checkout@v1 - name: rsync deployments - uses: burnett01/rsync-deployments@2.0 + uses: burnett01/rsync-deployments@3.0 with: switches: -avzr --delete path: src/ @@ -116,6 +116,15 @@ jobs: --- +## Version 2.0 + +Looking for version 2.0? + +Check here: https://github.com/Burnett01/rsync-deployments/tree/2.0 + +Version 2.0 uses a larger base-image (``ubuntu:latest``).
+Consider upgrading to 3.0 for even faster deployments. + ## Version 1.0 (EOL) Looking for version 1.0? From 7e62b51e322360d02531b96760b3b8a12c126fee Mon Sep 17 00:00:00 2001 From: Steven Agyekum Date: Fri, 27 Dec 2019 16:37:44 +0100 Subject: [PATCH 7/7] Update README.md --- README.md | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 3e1a840..32f630d 100644 --- a/README.md +++ b/README.md @@ -65,12 +65,6 @@ jobs: Advanced: ``` -name: DEPLOY -on: - push: - branches: - - master - jobs: deploy: runs-on: ubuntu-latest @@ -91,12 +85,6 @@ jobs: For better security, I suggest you create additional secrets for remote_host, remote_port and remote_user inputs. ``` -name: DEPLOY -on: - push: - branches: - - master - jobs: deploy: runs-on: ubuntu-latest @@ -114,6 +102,28 @@ jobs: remote_key: ${{ secrets.DEPLOY_KEY }} ``` +For maximum speed limit the checkout action (``actions/checkout@v1``) to a depth of 1: + +``` +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + with: + fetch-depth: 1 + - name: rsync deployments + uses: burnett01/rsync-deployments@3.0 + with: + switches: -avzr --delete + path: src/ + remote_path: /var/www/html/ + remote_host: ${{ secrets.DEPLOY_HOST }} + remote_port: ${{ secrets.DEPLOY_PORT }} + remote_user: ${{ secrets.DEPLOY_USER }} + remote_key: ${{ secrets.DEPLOY_KEY }} +``` + --- ## Version 2.0