workflow deploy to test server

This commit is contained in:
ngfrolov 2024-01-16 14:43:51 +05:00
parent b3b57dd224
commit 1f962aa1cb
Signed by: ng.frolov
GPG Key ID: E99907A0357B29A7

View File

@ -1,12 +1,12 @@
name: deploy name: deploy-test
run-name: ${{ gitea.actor }} is deploying run-name: ${{ gitea.actor }} is deploying to test server
on: on:
push: push:
branches: branches:
- dev - dev
jobs: jobs:
deploy: deploy-test:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
@ -21,13 +21,13 @@ jobs:
run: dotnet nuget add source --name gitea --username publisher --password ${{ secrets.PUBLISHER_PASSWORD }} --store-password-in-clear-text http://test.digitaldrilling.ru:8080/api/packages/DDrilling/nuget/index.json run: dotnet nuget add source --name gitea --username publisher --password ${{ secrets.PUBLISHER_PASSWORD }} --store-password-in-clear-text http://test.digitaldrilling.ru:8080/api/packages/DDrilling/nuget/index.json
- run: dotnet test AsbCloudWebApi.Tests - run: dotnet test AsbCloudWebApi.Tests
- run: dotnet publish AsbCloudWebApi --os linux --sc true -o ./build - run: dotnet publish AsbCloudWebApi --os linux --sc true -o ./build
- name: Deploy to Server - name: Deploy to Test server via rsync
uses: appleboy/ssh-action@v1.0.3 uses: burnett01/rsync-deployments@5.2.1
with: with:
host: test.digitaldrilling.ru switches: -avzr --delete --exclude="files" --exclude="appsettings.json"
username: asb path: ./build/
key: ${{ secrets.SSH_PRIVATE_KEY }} remote_path: /home/asb/AsbCloud/
port: 35222 remote_host: test.digitaldrilling.ru
script: | remote_user: asb
cd /home/asb/AsbCloudDeployTest/ remote_port: 35222
rsync -avzP --delete --exclude "backup" . ./backup remote_key: ${{ secrets.SSH_PRIVATE_KEY }}