DeployStream is a GitHub Workflow designed to streamline the process of deploying files from a GitHub repository to a VPS using SSH and rsync
. This workflow simplifies continuous deployment for projects by automating file synchronization with secure credentials.
- Automatically deploy files to your VPS when changes are pushed to the
main
branch. - Utilizes
rsync
for efficient file synchronization. - Securely manages SSH credentials using GitHub Secrets.
- Customizable file paths for local and remote directories.
Add the following example workflow to your .github/workflows/deploy.yml
file:
name: Deploy on Push
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Sync Files to VPS
uses: Sayemahamed/DeployStream/.github/actions/fileSync@main
with:
SSH_USERNAME: ${{ secrets.SSH_USERNAME }}
SSH_IPADDRESS: ${{ secrets.SSH_IPADDRESS }}
SSH_PASSWORD: ${{ secrets.SSH_PASSWORD }}
LOCAL_PATH: ${{ secrets.LOCAL_PATH }}
REMOTE_PATH: ${{ secrets.REMOTE_PATH }}
The action requires the following inputs:
Input | Description | Required |
---|---|---|
SSH_USERNAME |
SSH username for the VPS. | Yes |
SSH_IPADDRESS |
IP address of the VPS. | Yes |
SSH_PASSWORD |
Password for SSH authentication. | Yes |
LOCAL_PATH |
Path to the files in the repository to sync (e.g., ./ ). |
Yes |
REMOTE_PATH |
Path on the VPS where files will be deployed. | Yes |
To securely provide the required inputs, add the following secrets to your repository:
SSH_USERNAME
: Your SSH username.SSH_IPADDRESS
: The IP address of your VPS.SSH_PASSWORD
: Your SSH password.LOCAL_PATH
: The path in your repository to sync (e.g.,./
).REMOTE_PATH
: The destination path on the VPS.
To add these secrets:
- Go to your GitHub repository.
- Navigate to Settings > Secrets and variables > Actions.
- Click New repository secret and add each of the above secrets.
- Trigger: The workflow is triggered on every push to the
main
branch. - File Checkout: The repository is checked out using
actions/checkout
. - File Sync: The files specified in
LOCAL_PATH
are synced to the remote VPS atREMOTE_PATH
usingrsync
via SSH.
Contributions are welcome! Feel free to open an issue or submit a pull request to improve DeployStream.
DeployStream is licensed under the MIT License.