deployvps name change #8
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: Deploy .NET Application | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/[email protected] | |
name: Checkout code | |
- name: Setup .NET | |
uses: actions/[email protected] | |
with: | |
dotnet-version: '9.0.x' | |
- name: Restore dependencies | |
run: dotnet restore src/RadioModBackend.NET.csproj | |
- name: Publish | |
run: dotnet publish src/RadioModBackend.NET.csproj --configuration Release --no-restore --runtime linux-x64 --output ./publish | |
- name: Upload files via SCP | |
uses: appleboy/[email protected] | |
with: | |
host: ${{ secrets.VPS_SSH_HOST }} | |
username: ${{ secrets.VPS_SSH_USERNAME }} | |
key: ${{ secrets.VPS_SSH_PRIVATE_KEY }} | |
port: ${{ secrets.VPS_SSH_PORT }} | |
source: ./publish/RadioModBackend.NET | |
target: ${{ secrets.VPS_SSH_PATH }} | |
strip_components: 2 | |
- name: Restart app via SSH | |
uses: appleboy/[email protected] | |
with: | |
host: ${{ secrets.VPS_SSH_HOST }} | |
username: ${{ secrets.VPS_SSH_USERNAME }} | |
key: ${{ secrets.VPS_SSH_PRIVATE_KEY }} | |
port: ${{ secrets.VPS_SSH_PORT }} | |
script: | | |
scp -r ${{ secrets.VPS_SSH_PATH }}* ${{ secrets.SSH_PATH }}:~/ | |
ssh ${{ secrets.SSH_PATH }} "chmod +x ~/RadioModBackend.NET; ~/radiomod.sh restart" | |