mirror of
https://github.com/Burnett01/rsync-deployments.git
synced 2026-09-20 13:45:23 +08:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 23a557dceb | |||
| ea3f2b7314 | |||
| 469a77e7aa | |||
| 819cb701d2 |
@@ -1,8 +1,5 @@
|
||||
# rsync deployments
|
||||
|
||||
Forked from [Contention/rsync-deployments](https://github.com/Contention/rsync-deployments)
|
||||
|
||||
|
||||
This GitHub Action deploys files in `GITHUB_WORKSPACE` to a remote folder via rsync over ssh.
|
||||
|
||||
Use this action in a CD workflow which leaves deployable code in `GITHUB_WORKSPACE`.
|
||||
@@ -50,9 +47,9 @@ jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- uses: actions/checkout@v2
|
||||
- name: rsync deployments
|
||||
uses: burnett01/rsync-deployments@4.0
|
||||
uses: burnett01/rsync-deployments@4.1
|
||||
with:
|
||||
switches: -avzr --delete
|
||||
path: src/
|
||||
@@ -69,9 +66,9 @@ jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- uses: actions/checkout@v2
|
||||
- name: rsync deployments
|
||||
uses: burnett01/rsync-deployments@4.0
|
||||
uses: burnett01/rsync-deployments@4.1
|
||||
with:
|
||||
switches: -avzr --delete --exclude="" --include="" --filter=""
|
||||
path: src/
|
||||
@@ -89,31 +86,9 @@ jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- uses: actions/checkout@v2
|
||||
- name: rsync deployments
|
||||
uses: burnett01/rsync-deployments@4.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 2:
|
||||
|
||||
```
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
with:
|
||||
fetch-depth: 2
|
||||
- name: rsync deployments
|
||||
uses: burnett01/rsync-deployments@4.0
|
||||
uses: burnett01/rsync-deployments@4.1
|
||||
with:
|
||||
switches: -avzr --delete
|
||||
path: src/
|
||||
@@ -152,3 +127,12 @@ Looking for version 1.0?
|
||||
Check here: https://github.com/Burnett01/rsync-deployments/tree/1.0
|
||||
|
||||
Please note that version 1.0 has reached end of life state.
|
||||
|
||||
---
|
||||
|
||||
## Acknowledgements
|
||||
|
||||
+ This project is a fork of [Contention/rsync-deployments](https://github.com/Contention/rsync-deployments)
|
||||
+ Base image [JoshPiper/rsync-docker](https://github.com/JoshPiper/rsync-docker)
|
||||
|
||||
|
||||
|
||||
+10
-2
@@ -4,6 +4,14 @@
|
||||
source agent-start "$GITHUB_ACTION"
|
||||
echo "$INPUT_REMOTE_KEY" | agent-add
|
||||
|
||||
# Add strict errors and deploy.
|
||||
# Add strict errors.
|
||||
set -eu
|
||||
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"
|
||||
|
||||
# Variables.
|
||||
SWITCHES="$INPUT_SWITCHES"
|
||||
RSH="ssh -o StrictHostKeyChecking=no -p $INPUT_REMOTE_PORT $INPUT_RSH"
|
||||
LOCAL_PATH="$GITHUB_WORKSPACE/$INPUT_PATH"
|
||||
DSN="$INPUT_REMOTE_USER@$INPUT_REMOTE_HOST"
|
||||
|
||||
# Deploy.
|
||||
sh -c "rsync $SWITCHES -e '$RSH' $LOCAL_PATH $DSN:$INPUT_REMOTE_PATH"
|
||||
|
||||
Reference in New Issue
Block a user