Created
April 15, 2022 13:33
-
-
Save raazon/22fcc9071c83cabf9001edc0b9adbe2d to your computer and use it in GitHub Desktop.
GitHub Action for deploying code via rsync over ssh https://github.com/Burnett01/rsync-deployments
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 🚀 Production rsync deployment by SSH/SFTP | |
on: | |
push: | |
branches: [ main ] | |
jobs: | |
build: | |
name: Build | |
if: ${{ github.event.pull_request.merged }} == true | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: 🔄 rsync deployments | |
uses: burnett01/rsync-deployments@5.2 | |
with: | |
switches: -avzr --exclude=".git*" --filter="dir-merge,- .gitignore" --delete-after --progress ./ ./ | |
path: ./* | |
remote_path: ${{ secrets.REMOTE_TARGET }} | |
remote_host: ${{ secrets.HOST }} | |
remote_port: ${{ secrets.PORT_PRODUCTION }} | |
remote_user: ${{ secrets.USERNAME }} | |
remote_key: ${{ secrets.PRIVATE_KEY }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 🚧 Staging rsync deployment by SSH/SFTP | |
on: | |
push: | |
branches-ignore: [ main ] | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: 🔄 rsync deployments | |
uses: burnett01/rsync-deployments@5.2 | |
with: | |
switches: -avzr --exclude=".git*" --filter="dir-merge,- .gitignore" --delete-after --progress ./ ./ | |
path: ./* | |
remote_path: ${{ secrets.REMOTE_TARGET }} | |
remote_host: ${{ secrets.HOST }} | |
remote_port: ${{ secrets.PORT_STAGING }} | |
remote_user: ${{ secrets.USERNAME }} | |
remote_key: ${{ secrets.PRIVATE_KEY }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment