Compare commits

..

5 Commits

Author SHA1 Message Date
Steven 3e8a824ef9 chore: readme changes 2025-12-07 12:51:42 +01:00
Steven 1512f2079d chore: 8.0.2 2025-12-07 12:49:52 +01:00
Steven 501415e740 fix: reverting printf in favor of echo
Like in commit 2c22263 we are using echo again instead of printf because some runners can't function properly with it.
2025-12-07 12:36:01 +01:00
Steven 1002e5f311 fix: only attempt to create file if it doesn't exist yet
On self-hosted runners it can happen that an action (docker container) is cached, resulting in aborting this script because the know_hosts file already exists. 
This if clause fixes it.
Setting permissions is intentionally outside the if clause because in all cases we want to reset perms.
2025-12-07 12:33:49 +01:00
Steven 400135b4a7 fix: only attempt to create dir if not yet exists
On self-hosted runners it can happen that an action (docker container) is cached. This leads to the script trying to create the .ssh dir despite it already existing. The action then fails.
2025-12-07 12:31:06 +01:00
9 changed files with 89 additions and 143 deletions
-1
View File
@@ -1 +0,0 @@
github: [burnett01]
-4
View File
@@ -4,7 +4,3 @@ updates:
directory: / directory: /
schedule: schedule:
interval: monthly interval: monthly
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
@@ -23,7 +23,7 @@ jobs:
name: Test BATS Suite name: Test BATS Suite
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v7 uses: actions/checkout@v4
- name: Install BATS - name: Install BATS
run: | run: |
@@ -38,7 +38,7 @@ jobs:
name: Validate Action Definition name: Validate Action Definition
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v7 uses: actions/checkout@v4
- name: Validate action.yml - name: Validate action.yml
run: | run: |
@@ -81,7 +81,7 @@ jobs:
needs: [validate-action, action-structure] needs: [validate-action, action-structure]
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v7 uses: actions/checkout@v4
- name: Build Docker image - name: Build Docker image
run: | run: |
@@ -94,7 +94,7 @@ jobs:
name: Validate Action Structure name: Validate Action Structure
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v7 uses: actions/checkout@v4
- name: Check required files - name: Check required files
run: | run: |
@@ -128,7 +128,7 @@ jobs:
name: Lint Shell Scripts name: Lint Shell Scripts
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v7 uses: actions/checkout@v4
- name: Install ShellCheck - name: Install ShellCheck
run: | run: |
@@ -151,7 +151,7 @@ jobs:
needs: [test, validate-action, docker-build, action-structure, lint-shell] needs: [test, validate-action, docker-build, action-structure, lint-shell]
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v7 uses: actions/checkout@v4
- name: Final integration check - name: Final integration check
run: | run: |
@@ -19,7 +19,7 @@ jobs:
actions: read actions: read
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v7 - uses: actions/checkout@v4
- name: Build a Docker image - name: Build a Docker image
run: docker build -t burnett01/rsync-deployments . run: docker build -t burnett01/rsync-deployments .
- name: Run Snyk to check Docker image for vulnerabilities - name: Run Snyk to check Docker image for vulnerabilities
+2 -2
View File
@@ -1,6 +1,6 @@
FROM alpine:3.24.1@sha256:28bd5fe8b56d1bd048e5babf5b10710ebe0bae67db86916198a6eec434943f8b AS base FROM alpine:3.23.0@sha256:51183f2cfa6320055da30872f211093f9ff1d3cf06f39a0bdb212314c5dc7375 AS base
RUN apk update && apk add --no-cache --upgrade 'rsync>=3.5.0-r0' openssh openssl busybox RUN apk update && apk add --no-cache --upgrade rsync openssh openssl busybox
RUN rm -rf /var/cache/apk/* RUN rm -rf /var/cache/apk/*
+2 -2
View File
@@ -1,8 +1,8 @@
MIT License MIT License
Copyright (c) 2019-2022 Contention Copyright (c) 2019-2022 Contention
Copyright (c) 2019-2026 Joshua Piper (Dr Internet) Copyright (c) 2019-2025 Joshua Piper (Dr Internet)
Copyright (c) 2019-2026 Burnett01 Copyright (c) 2019-2025 Burnett01
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
+62 -106
View File
@@ -10,50 +10,13 @@ This cross-platform GitHub Action deploys files in [`path`](#inputs) (relative t
Use this action in a CD workflow which leaves deployable code in `GITHUB_WORKSPACE`, such [actions/checkout](https://github.com/actions/checkout). Use this action in a CD workflow which leaves deployable code in `GITHUB_WORKSPACE`, such [actions/checkout](https://github.com/actions/checkout).
The base-image of this action is very small and based on **Alpine 3.24.1** (no cache) which results in fast deployments. The base-image of this action is very small and based on **Alpine 3.23.0** (no cache) which results in fast deployments.
Alpine version: [3.24.1](https://www.alpinelinux.org/posts/Alpine-3.24.1-released.html) Alpine version: [3.23.0](https://www.alpinelinux.org/posts/Alpine-3.23.0-released.html)
Rsync version: [3.5.0-r0](https://download.samba.org/pub/rsync/NEWS#3.5.0) Rsync version: [3.4.1-r1](https://download.samba.org/pub/rsync/NEWS#3.4.1)
## Current Version: v9 (9.0.1)
### Release channels:
| Version | Purpose | Immutable |
| ------- | ------------------ | ------------------ |
| ``v9`` (recommended, LTS) | latest MAJOR (pointer to 9.MINOR.PATCH) | no |
| 9.0.1 | latest MAJOR+MINOR+PATCH | yes |
| ``v8`` (ESU) | previous MAJOR (pointer to 8.MINOR.PATCH) | no |
| 8.0.5 | previous MAJOR+MINOR+PATCH | yes |
Check [SECURITY.md](SECURITY.md) for support cycles.
--- ---
## How it works
```yml
name: DEPLOY
on:
push:
branches:
- master
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: rsync deployments
uses: burnett01/rsync-deployments@v9
with:
switches: -avzr --delete
path: src/
remote_path: ${{ secrets.REMOTE_PATH }} # ex: /var/www/html/
remote_host: ${{ secrets.REMOTE_HOST }} # ex: example.com
remote_port: ${{ secrets.REMOTE_PORT }} # ex: 22
remote_user: ${{ secrets.REMOTE_USER }} # ex: ubuntu
remote_key: ${{ secrets.REMOTE_PRIVATE_KEY }}
```
## Inputs ## Inputs
- `debug`* - Whether to enable debug output. ("true" / "false") - Default: "false" - `debug`* - Whether to enable debug output. ("true" / "false") - Default: "false"
@@ -90,9 +53,19 @@ This action needs secret variables for the ssh private key of your key pair. The
For simplicity, we are using `REMOTE_*` as the secret variables throughout the examples. For simplicity, we are using `REMOTE_*` as the secret variables throughout the examples.
## Example usage ## Current Version: v8 (8.0.2)
For better **security** always use secrets for remote_host, remote_port, remote_user and remote_path inputs. ### Release channels:
| Version | Purpose | Immutable |
| ------- | ------------------ | ------------------ |
| ``v8`` | latest release (pointer to 8.x.x) | no, points to latest MINOR,PATCH |
| 8.0.2 | latest major release | yes |
| 7.1.0 | previous release | yes |
Check [SECURITY.md](SECURITY.md) for support cycles.
## Example usage
Simple: Simple:
@@ -107,36 +80,55 @@ jobs:
deploy: deploy:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v7 - uses: actions/checkout@v6
- name: rsync deployments - name: rsync deployments
uses: burnett01/rsync-deployments@v9 uses: burnett01/rsync-deployments@v8
with: with:
switches: -avzr --delete switches: -avzr --delete
path: src/ path: src/
remote_path: ${{ secrets.REMOTE_PATH }} # ex: /var/www/html/ remote_path: /var/www/html/
remote_host: ${{ secrets.REMOTE_HOST }} # ex: example.com remote_host: example.com
remote_port: ${{ secrets.REMOTE_PORT }} # ex: 22 remote_user: debian
remote_user: ${{ secrets.REMOTE_USER }} # ex: ubuntu
remote_key: ${{ secrets.REMOTE_PRIVATE_KEY }} remote_key: ${{ secrets.REMOTE_PRIVATE_KEY }}
``` ```
Advanced (with filters etc): Advanced:
```yml ```yml
jobs: jobs:
deploy: deploy:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v7 - uses: actions/checkout@v6
- name: rsync deployments - name: rsync deployments
uses: burnett01/rsync-deployments@v9 uses: burnett01/rsync-deployments@v8
with: with:
switches: -avzr --delete --exclude="" --include="" --filter="" switches: -avzr --delete --exclude="" --include="" --filter=""
path: src/ path: src/
remote_path: ${{ secrets.REMOTE_PATH }} # ex: /var/www/html/ remote_path: /var/www/html/
remote_host: ${{ secrets.REMOTE_HOST }} # ex: example.com remote_host: example.com
remote_port: ${{ secrets.REMOTE_PORT }} # ex: 22 remote_port: 5555
remote_user: ${{ secrets.REMOTE_USER }} # ex: ubuntu remote_user: debian
remote_key: ${{ secrets.REMOTE_PRIVATE_KEY }}
```
For better **security**, I suggest you create additional secrets for remote_host, remote_port, remote_user and remote_path inputs.
```yml
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: rsync deployments
uses: burnett01/rsync-deployments@v8
with:
switches: -avzr --delete
path: src/
remote_path: ${{ secrets.REMOTE_PATH }}
remote_host: ${{ secrets.REMOTE_HOST }}
remote_port: ${{ secrets.REMOTE_PORT }}
remote_user: ${{ secrets.REMOTE_USER }}
remote_key: ${{ secrets.REMOTE_PRIVATE_KEY }} remote_key: ${{ secrets.REMOTE_PRIVATE_KEY }}
``` ```
@@ -147,16 +139,16 @@ jobs:
deploy: deploy:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v7 - uses: actions/checkout@v6
- name: rsync deployments - name: rsync deployments
uses: burnett01/rsync-deployments@v9 uses: burnett01/rsync-deployments@v8
with: with:
switches: -avzr --delete switches: -avzr --delete
path: src/ path: src/
remote_path: ${{ secrets.REMOTE_PATH }} # ex: /var/www/html/ remote_path: ${{ secrets.REMOTE_PATH }}
remote_host: ${{ secrets.REMOTE_HOST }} # ex: example.com remote_host: ${{ secrets.REMOTE_HOST }}
remote_port: ${{ secrets.REMOTE_PORT }} # ex: 22 remote_port: ${{ secrets.REMOTE_PORT }}
remote_user: ${{ secrets.REMOTE_USER }} # ex: ubuntu remote_user: ${{ secrets.REMOTE_USER }}
remote_key: ${{ secrets.REMOTE_PRIVATE_KEY }} remote_key: ${{ secrets.REMOTE_PRIVATE_KEY }}
remote_key_pass: ${{ secrets.REMOTE_PRIVATE_KEY_PASS }} remote_key_pass: ${{ secrets.REMOTE_PRIVATE_KEY_PASS }}
``` ```
@@ -173,17 +165,17 @@ jobs:
deploy: deploy:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v7 - uses: actions/checkout@v6
- name: rsync deployments - name: rsync deployments
uses: burnett01/rsync-deployments@v9 uses: burnett01/rsync-deployments@v8
with: with:
switches: -avzr --delete switches: -avzr --delete
legacy_allow_rsa_hostkeys: "true" legacy_allow_rsa_hostkeys: "true"
path: src/ path: src/
remote_path: ${{ secrets.REMOTE_PATH }} # ex: /var/www/html/ remote_path: ${{ secrets.REMOTE_PATH }}
remote_host: ${{ secrets.REMOTE_HOST }} # ex: example.com remote_host: ${{ secrets.REMOTE_HOST }}
remote_port: ${{ secrets.REMOTE_PORT }} # ex: 22 remote_port: ${{ secrets.REMOTE_PORT }}
remote_user: ${{ secrets.REMOTE_USER }} # ex: ubuntu remote_user: ${{ secrets.REMOTE_USER }}
remote_key: ${{ secrets.REMOTE_PRIVATE_KEY }} remote_key: ${{ secrets.REMOTE_PRIVATE_KEY }}
``` ```
@@ -285,56 +277,20 @@ sudo apk add rsync
## Versions ## Versions
## Version 9.0.0
Check here:
- https://github.com/Burnett01/rsync-deployments/tree/9.0.0 (alpine 3.24.1)
## Version 8.0.5
Check here:
- https://github.com/Burnett01/rsync-deployments/tree/8.0.5 (alpine 3.23.4)
## Version 8.0.4
Check here:
- https://github.com/Burnett01/rsync-deployments/tree/8.0.4 (alpine 3.23.3)
## Version 8.0.3
Check here:
- https://github.com/Burnett01/rsync-deployments/tree/8.0.3 (alpine 3.23.2)
## Version 8.0.2
Check here:
- https://github.com/Burnett01/rsync-deployments/tree/8.0.2 (alpine 3.23.0)
## Version 8.0.1 (EOL)
Check here:
- https://github.com/Burnett01/rsync-deployments/tree/8.0.1 (alpine 3.23.0)
## Version 8.0.0 (EOL due to regression -> fixed via 8.0.1 & 8.0.2) ## Version 8.0.0 (EOL due to regression -> fixed via 8.0.1 & 8.0.2)
Check here: Check here:
- https://github.com/Burnett01/rsync-deployments/tree/8.0.0 (alpine 3.23.0) - https://github.com/Burnett01/rsync-deployments/tree/8.0.0 (alpine 3.23.0)
## Version 7.1.0 (EOL) ## Version 7.1.0
Check here: Check here:
- https://github.com/Burnett01/rsync-deployments/tree/7.1.0 (alpine 3.22.1) - https://github.com/Burnett01/rsync-deployments/tree/7.1.0 (alpine 3.22.1)
## Version 7.0.2 (EOL) ## Version 7.0.2 (DEPRECATED)
Check here: Check here:
@@ -408,7 +364,7 @@ Please note that version 1.0 has reached end of life state.
## Acknowledgements ## Acknowledgements
+ This project is a fork of [Contention/rsync-deployments](https://github.com/Contention/rsync-deployments) + This project is a fork of [Contention/rsync-deployments](https://github.com/Contention/rsync-deployments)
+ docker-rsync [JoshPiper/rsync-docker](https://github.com/JoshPiper/rsync-docker) + Base image [JoshPiper/rsync-docker](https://github.com/JoshPiper/rsync-docker)
--- ---
+15 -20
View File
@@ -6,26 +6,21 @@ The Docker image and code quality are regularly checked for vulnerabilities and
The following versions are currently being supported with security updates: The following versions are currently being supported with security updates:
| Version | Supported | Rsync version | Alpine version | Support Until | | Version | Supported | Rsync version | Alpine version |
| ------- | ------------------ | ------------------ | ------------------ | ------------------ | | ------- | ------------------ | ------------------ | ------------------ |
| (``v9``) 9.0.1 | :white_check_mark: | >= 3.5.0-r0 | 3.24.1 | LTS (2028-*) | | 8.0.2 | :white_check_mark: | >= 3.4.1-r1 | 3.23.0 |
| 9.0.0 | :white_check_mark: | >= 3.4.3-r1 | 3.24.1 | LTS (2028-*) | | 8.0.1 | :white_check_mark: | >= 3.4.1-r1 | 3.23.0 |
| (``v8``) 8.0.5 | :white_check_mark: | >= 3.4.1-r1 | 3.23.4 | ESU (Apr, 1st 2027) | | 8.0.0 | :x: EOL (due to regression #90) | >= 3.4.1-r1 | 3.23.0 |
| 8.0.4 | :warning: DEPRECATED | >= 3.4.1-r1 | 3.23.3 | Dec, 6th 2026 | | 7.1.0 | :white_check_mark: | >= 3.4.1-r0 | 3.22.1 |
| 8.0.3 | :warning: DEPRECATED | >= 3.4.1-r1 | 3.23.2 | Dec, 6th 2026 | | 7.0.2 | :warning: DEPRECATED | >= 3.4.0-r0 | 3.22.1 |
| 8.0.2 | :warning: DEPRECATED | >= 3.4.1-r1 | 3.23.0 | Dec, 6th 2026 | | 7.0.1 | :x: EOL | < 3.4.0 | 3.22.1 |
| 8.0.1 | :x: EOL | >= 3.4.1-r1 | 3.23.0 | † Apr, 1st 2026 | | 7.0.0 | :x: EOL | < 3.4.0| 3.19.1 |
| 8.0.0 | :x: EOL (due to regression #90) | >= 3.4.1-r1 | 3.23.0 | † Dec, 6th 2025 | | 6.x | :x: EOL |< 3.4.0| 3.17.2 |
| 7.1.0 | :x: EOL | >= 3.4.1-r0 | 3.22.1 | † June, 1st 2026 ([deprecation notice](https://github.com/Burnett01/rsync-deployments/discussions/96)) | | 5.x | :x: EOL |< 3.4.0| 3.11 - 3.14.1 - 3.15 - 3.16 - 3.17.2 |
| 7.0.2 | :x: EOL | >= 3.4.0-r0 | 3.22.1 | † June, 1st 2026 ([deprecation notice](https://github.com/Burnett01/rsync-deployments/discussions/96)) | | 4.x | :x: EOL |< 3.4.0| 3.11 |
| 7.0.1 | :x: EOL | < 3.4.0 | 3.22.1 | † Dec, 6th 2025 | | 3.0 | :x: EOL |< 3.4.0| N/A |
| 7.0.0 | :x: EOL | < 3.4.0| 3.19.1 | † Dec, 6th 2025 | | 2.0 | :x: EOL |< 3.4.0| Ubuntu |
| 6.x | :x: EOL |< 3.4.0| 3.17.2 | † 2024 | | 1.0 | :x: EOL |< 3.4.0| Ubuntu |
| 5.x | :x: EOL |< 3.4.0| 3.11 - 3.14.1 - 3.15 - 3.16 - 3.17.2 | † 2024 |
| 4.x | :x: EOL |< 3.4.0| 3.11 | † |
| 3.0 | :x: EOL |< 3.4.0| N/A | † |
| 2.0 | :x: EOL |< 3.4.0| Ubuntu | † |
| 1.0 | :x: EOL |< 3.4.0| Ubuntu | † |
### Terminology ### Terminology
+1 -1
View File
@@ -1,5 +1,5 @@
name: 'Rsync Deployments Action' name: 'Rsync Deployments Action'
description: 'GitHub Action for deploying code via rsync over ssh securely - used by 5k+ workflows!' description: 'GitHub Action for deploying code via rsync over ssh'
author: 'Burnett01' author: 'Burnett01'
inputs: inputs:
switches: switches: