name: Deploy run-name: Deploy 🚀 on: [push] jobs: Deploy: runs-on: ubuntu-latest steps: - name: Check out repository code uses: actions/checkout@v3 - name: Install dotnet run: | wget https://dot.net/v1/dotnet-install.sh -O dotnet-install.sh chmod +x dotnet-install.sh ./dotnet-install.sh - name: Compile MyMcRealms run: /home/runner/.dotnet/dotnet publish --runtime linux-arm64 - name: Install sshpass run: | sudo apt-get update sudo apt-get install sshpass - name: Stop the realms server for the deployment run: sshpass -p '${{ secrets.VPS_PASSWORD }}' ssh -o StrictHostKeyChecking=no ${{ secrets.VPS_HOST }} -p ${{ secrets.VPS_PORT }} "pm2 stop 0" - name: Deploy compiled binary and dll files to server run: sshpass -p '${{ secrets.VPS_PASSWORD }}' scp -P ${{ secrets.VPS_PORT }} -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -r MyMcRealms/bin/Release/net8.0/linux-arm64/publish/* ${{ secrets.VPS_HOST }}:/home/cyber/MyMcRealms - name: Start the realms server again run: sshpass -p '${{ secrets.VPS_PASSWORD }}' ssh -o StrictHostKeyChecking=no ${{ secrets.VPS_HOST }} -p ${{ secrets.VPS_PORT }} "pm2 start 0"