Version 3.0 - faster deployments

* Feat/new base image
This commit is contained in:
Steven Agyekum 2019-12-27 16:39:11 +01:00 committed by GitHub
commit c47cfee594
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 42 additions and 23 deletions

View File

@ -1,12 +1,10 @@
FROM ubuntu:latest FROM alpine:latest
# Update # Update
RUN apt-get update RUN apk --update --no-cache add rsync bash openssh-client
# Install packages
RUN apt-get -yq install rsync openssh-client
# Copy entrypoint # Copy entrypoint
ADD entrypoint.sh /entrypoint.sh ADD entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"] ENTRYPOINT ["/entrypoint.sh"]

View File

@ -3,9 +3,11 @@
Forked from [Contention/rsync-deployments](https://github.com/Contention/rsync-deployments) 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: steps:
- uses: actions/checkout@v1 - uses: actions/checkout@v1
- name: rsync deployments - name: rsync deployments
uses: burnett01/rsync-deployments@2.0 uses: burnett01/rsync-deployments@3.0
with: with:
switches: -avzr --delete switches: -avzr --delete
path: src/ path: src/
@ -63,19 +65,13 @@ jobs:
Advanced: Advanced:
``` ```
name: DEPLOY
on:
push:
branches:
- master
jobs: jobs:
deploy: deploy:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v1 - uses: actions/checkout@v1
- name: rsync deployments - name: rsync deployments
uses: burnett01/rsync-deployments@2.0 uses: burnett01/rsync-deployments@3.0
with: with:
switches: -avzr --delete --exclude="" --include="" --filter="" switches: -avzr --delete --exclude="" --include="" --filter=""
path: src/ 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. 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: jobs:
deploy: deploy:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v1 - uses: actions/checkout@v1
- name: rsync deployments - 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: with:
switches: -avzr --delete switches: -avzr --delete
path: src/ 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) ## Version 1.0 (EOL)
Looking for version 1.0? Looking for version 1.0?

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -eu set -eu