Skip to content

Instantly share code, notes, and snippets.

@raazon
Created April 15, 2022 13:33
Show Gist options
  • Select an option

  • Save raazon/22fcc9071c83cabf9001edc0b9adbe2d to your computer and use it in GitHub Desktop.

Select an option

Save raazon/22fcc9071c83cabf9001edc0b9adbe2d to your computer and use it in GitHub Desktop.

Revisions

  1. raazon created this gist Apr 15, 2022.
    24 changes: 24 additions & 0 deletions production.yml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,24 @@
    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/[email protected]
    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 }}
    23 changes: 23 additions & 0 deletions staging.yml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,23 @@
    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/[email protected]
    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 }}