Deploy to Dev Server #123
This file contains hidden or 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 to Dev Server | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
schedule: | |
- cron: '0 0 * * *' # Runs daily at midnight UTC (Refresh server in-case of crashes) | |
jobs: | |
build: | |
name: Deploy | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup .NET Core SDK | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: '8.x.x' | |
- name: Publish build artifacts | |
run: dotnet publish WarcraftPlugin/WarcraftPlugin.csproj --configuration Release --output ./publish | |
- name: Execute remote SSH commands | |
uses: easingthemes/ssh-deploy@main | |
with: | |
REMOTE_HOST: ${{ secrets.HOST }} | |
REMOTE_USER: ${{ secrets.USERNAME }} | |
SSH_PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }} | |
SOURCE: "./publish/" | |
TARGET: "/home/steam/steamcmd/cs2-ds/game/csgo/addons/counterstrikesharp/plugins/WarcraftPlugin" | |
ARGS: "-rlgoDzvc -i" | |
SCRIPT_AFTER: | | |
sudo chown -R steam:steam /home/steam/steamcmd/ | |
bash -ic 'cs2 update' |