mirror of
https://github.com/Burnett01/rsync-deployments.git
synced 2026-09-20 05:35:54 +08:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c269e19dd0 | |||
| c39ab06b30 | |||
| 9f59b515f6 | |||
| c5464e03ed | |||
| 0010c2adf6 | |||
| c6d9be15a7 | |||
| d75a44a646 |
+2
-5
@@ -1,10 +1,7 @@
|
||||
FROM alpine:latest
|
||||
|
||||
# Update
|
||||
RUN apk --update --no-cache add rsync bash openssh-client
|
||||
FROM drinternet/rsync:1.0.1
|
||||
|
||||
# Copy entrypoint
|
||||
ADD entrypoint.sh /entrypoint.sh
|
||||
COPY entrypoint.sh /entrypoint.sh
|
||||
RUN chmod +x /entrypoint.sh
|
||||
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2019 Contention
|
||||
Copyright (c) 2019 Burnett01
|
||||
Copyright (c) 2019-2020 Contention
|
||||
Copyright (c) 2019-2020 Burnett01
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@@ -7,7 +7,7 @@ This GitHub Action deploys files in `GITHUB_WORKSPACE` to a remote folder via rs
|
||||
|
||||
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.
|
||||
The underlaying base-image of the docker-image is very small (Alpine (no cache)) which results in fast deployments.
|
||||
|
||||
---
|
||||
|
||||
@@ -52,7 +52,7 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: rsync deployments
|
||||
uses: burnett01/rsync-deployments@3.0
|
||||
uses: burnett01/rsync-deployments@4.0
|
||||
with:
|
||||
switches: -avzr --delete
|
||||
path: src/
|
||||
@@ -71,7 +71,7 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: rsync deployments
|
||||
uses: burnett01/rsync-deployments@3.0
|
||||
uses: burnett01/rsync-deployments@4.0
|
||||
with:
|
||||
switches: -avzr --delete --exclude="" --include="" --filter=""
|
||||
path: src/
|
||||
@@ -91,7 +91,7 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: rsync deployments
|
||||
uses: burnett01/rsync-deployments@3.0
|
||||
uses: burnett01/rsync-deployments@4.0
|
||||
with:
|
||||
switches: -avzr --delete
|
||||
path: src/
|
||||
@@ -102,7 +102,7 @@ jobs:
|
||||
remote_key: ${{ secrets.DEPLOY_KEY }}
|
||||
```
|
||||
|
||||
For maximum speed limit the checkout action (``actions/checkout@v1``) to a depth of 1:
|
||||
For maximum speed limit the checkout action (``actions/checkout@v1``) to a depth of 2:
|
||||
|
||||
```
|
||||
jobs:
|
||||
@@ -111,9 +111,9 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
with:
|
||||
fetch-depth: 1
|
||||
fetch-depth: 2
|
||||
- name: rsync deployments
|
||||
uses: burnett01/rsync-deployments@3.0
|
||||
uses: burnett01/rsync-deployments@4.0
|
||||
with:
|
||||
switches: -avzr --delete
|
||||
path: src/
|
||||
@@ -126,6 +126,16 @@ jobs:
|
||||
|
||||
---
|
||||
|
||||
## Version 3.0
|
||||
|
||||
Looking for version 3.0?
|
||||
|
||||
Check here: https://github.com/Burnett01/rsync-deployments/tree/3.0
|
||||
|
||||
Version 3.0 uses the ``alpine:latest`` base-image directly.<br>
|
||||
Consider upgrading to 4.0 that uses a docker-image ``drinternet/rsync:1.0.1`` that is<br>
|
||||
based on ``alpine:latest``and heavily optimized for rsync.
|
||||
|
||||
## Version 2.0
|
||||
|
||||
Looking for version 2.0?
|
||||
|
||||
+7
-16
@@ -1,18 +1,9 @@
|
||||
#!/usr/bin/env bash
|
||||
#!/bin/sh
|
||||
|
||||
# Start the SSH agent and load key.
|
||||
source agent-start "$GITHUB_ACTION"
|
||||
echo "$INPUT_REMOTE_KEY" | agent-add
|
||||
|
||||
# Add strict errors and deploy.
|
||||
set -eu
|
||||
|
||||
# Set deploy key
|
||||
SSH_PATH="$HOME/.ssh"
|
||||
|
||||
# Create .ssh dir if it doesn't exist
|
||||
[ -d "$SSH_PATH" ] || mkdir "$SSH_PATH"
|
||||
|
||||
# Place deploy_key into .ssh dir
|
||||
echo "$INPUT_REMOTE_KEY" > "$SSH_PATH/key"
|
||||
|
||||
# Set r+w to user only
|
||||
chmod 600 "$SSH_PATH/key"
|
||||
|
||||
# Do deployment
|
||||
sh -c "rsync $INPUT_SWITCHES -e 'ssh -i $SSH_PATH/key -o StrictHostKeyChecking=no -p $INPUT_REMOTE_PORT $INPUT_RSH' $GITHUB_WORKSPACE/$INPUT_PATH $INPUT_REMOTE_USER@$INPUT_REMOTE_HOST:$INPUT_REMOTE_PATH"
|
||||
sh -c "rsync $INPUT_SWITCHES -e 'ssh -o StrictHostKeyChecking=no -p $INPUT_REMOTE_PORT $INPUT_RSH' $GITHUB_WORKSPACE/$INPUT_PATH $INPUT_REMOTE_USER@$INPUT_REMOTE_HOST:$INPUT_REMOTE_PATH"
|
||||
|
||||
Reference in New Issue
Block a user