Compare commits

...

8 Commits

Author SHA1 Message Date
Steven Agyekum c47cfee594 Version 3.0 - faster deployments
* Feat/new base image
2019-12-27 16:39:11 +01:00
Steven Agyekum 7e62b51e32 Update README.md 2019-12-27 16:37:44 +01:00
Steven Agyekum f8c929a1f4 Update README.md 2019-12-27 16:33:45 +01:00
Steven Agyekum 6a989b68a1 Update README.md 2019-12-27 16:29:01 +01:00
Steven Agyekum 6fa9b56771 Update Dockerfile 2019-12-27 16:14:47 +01:00
Steven Agyekum f5c5431bf6 Update entrypoint.sh 2019-12-27 16:12:10 +01:00
Steven Agyekum 20b1f5b4b8 Update Dockerfile 2019-12-27 16:11:54 +01:00
Steven Agyekum 1bbe8382e5 Update Dockerfile 2019-12-27 16:08:00 +01:00
3 changed files with 42 additions and 23 deletions
+3 -5
View File
@@ -1,12 +1,10 @@
FROM ubuntu:latest
FROM alpine:latest
# Update
RUN apt-get update
# Install packages
RUN apt-get -yq install rsync openssh-client
RUN apk --update --no-cache add rsync bash openssh-client
# Copy entrypoint
ADD entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
+38 -17
View File
@@ -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.
---
@@ -50,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/
@@ -63,19 +65,13 @@ jobs:
Advanced:
```
name: DEPLOY
on:
push:
branches:
- master
jobs:
deploy:
runs-on: ubuntu-latest
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/
@@ -89,19 +85,35 @@ 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
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/
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 }}
```
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/
@@ -114,6 +126,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``).<br>
Consider upgrading to 3.0 for even faster deployments.
## Version 1.0 (EOL)
Looking for version 1.0?
+1 -1
View File
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -eu