Skip to content

Instantly share code, notes, and snippets.

@milosh-96
Created September 1, 2025 16:32
Show Gist options
  • Select an option

  • Save milosh-96/fca59079c273c960b070f4a33661687e to your computer and use it in GitHub Desktop.

Select an option

Save milosh-96/fca59079c273c960b070f4a33661687e to your computer and use it in GitHub Desktop.
Orchard Core - deploy to Linux VPS workflow
name: Deploy to VPS
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Build and Publish
run: dotnet publish -c Release -o ./publish
- name: Deploy to VPS (rsync over SSH)
uses: appleboy/scp-action@master
with:
host: ${{ secrets.VPS_HOST }}
# if your port is 22, then you can just remove the port from this configuration #
port: ${{ secrets.VPS_PORT }}
username: ${{ secrets.VPS_USER }}
password: ${{ secrets.VPS_PASSWORD }}
source: "publish/*"
target: "<YOUR PUBLISH PATH>"
rm: false
strip_components: 1
# Exclude App_Data folder from overwrite
exclude: "App_Data/*"
- name: Restart App on VPS
uses: appleboy/[email protected]
with:
host: ${{ secrets.VPS_HOST }}
port: 30222
username: ${{ secrets.VPS_USER }}
password: ${{ secrets.VPS_PASSWORD }}
script: |
cd <YOUR PUBLISH PATH>
# Example: restart systemd service
sudo systemctl stop <YOUR SERVICE NAME>
sudo systemctl start <YOUR SERVICE NAME>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment