Add ability to load sources which are not a nginx file listing. #75
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 | |
on: | |
push: | |
branches: | |
- master | |
workflow_dispatch: | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
env: | |
Solution_Name: ReplayBrowser.sln | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Install .NET Core | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 8.0.x | |
- name: Build Client | |
run: dotnet build ./Client/Client.csproj | |
- name: Build Server | |
run: dotnet build ./Server/Server.csproj | |
- name: Install SSH Key | |
uses: webfactory/ssh-agent@v0.9.0 | |
with: | |
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} | |
- name: Prepare files for deployment | |
run: | | |
mkdir deploy | |
rsync -av --exclude='bin' --exclude='obj' --exclude='.git' --exclude='deploy' ./ ./deploy | |
echo '${{ secrets.SERVER_APPSETTINGS }}' > ./deploy/Server/appsettings.Secret.json | |
echo '${{ secrets.CLIENT_APPSETTINGS }}' > ./deploy/Client/appsettings.json | |
- name: Upload files to server | |
uses: appleboy/scp-action@master | |
with: | |
host: ${{ secrets.SERVER_IP }} | |
username: ${{ secrets.SERVER_USERNAME }} | |
key: ${{ secrets.SSH_PRIVATE_KEY }} | |
source: "./deploy/*" | |
target: /home/${{ secrets.SERVER_USERNAME }}/ReplayBrowser | |
- name: End services | |
run: | | |
ssh -o StrictHostKeyChecking=no ${{ secrets.SERVER_USERNAME }}@${{ secrets.SERVER_IP }} "sudo systemctl stop replaybrowser.client.service" | |
ssh -o StrictHostKeyChecking=no ${{ secrets.SERVER_USERNAME }}@${{ secrets.SERVER_IP }} "sudo systemctl stop replaybrowser.server.service" | |
- name: Start services | |
run: | | |
ssh -o StrictHostKeyChecking=no ${{ secrets.SERVER_USERNAME }}@${{ secrets.SERVER_IP }} "sudo systemctl start replaybrowser.client.service" | |
ssh -o StrictHostKeyChecking=no ${{ secrets.SERVER_USERNAME }}@${{ secrets.SERVER_IP }} "sudo systemctl start replaybrowser.server.service" |