From 4fa8d980e2e14520b78e22a5be9aaa9d4ad81cc0 Mon Sep 17 00:00:00 2001 From: ngfrolov Date: Tue, 16 Jan 2024 11:33:03 +0500 Subject: [PATCH] Add deploy test1 --- .gitea/workflows/deploy.yaml | 31 +++++++++++++++++++++++++++++++ .gitea/workflows/unit-tests.yaml | 23 +++++++++++++++++++++++ AsbCloud.sln | 2 +- 3 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 .gitea/workflows/deploy.yaml create mode 100644 .gitea/workflows/unit-tests.yaml diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml new file mode 100644 index 00000000..025f6bd1 --- /dev/null +++ b/.gitea/workflows/deploy.yaml @@ -0,0 +1,31 @@ +name: deploy +run-name: ${{ gitea.actor }} is deploying +on: + push: + branches: + - dev + +jobs: + deploy: + runs-on: ubuntu-latest + + steps: + - name: Setup dotnet + if: ${{ steps.cache-dotnet.outputs.cache-hit != 'true' }} + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 6.0.x + - name: Check out repository code + uses: actions/checkout@v4 + - run: dotnet test AsbCloudWebApi.Tests + - run: dotnet publish AsbCloudWebApi --os linux --sc true -o ./build + - name: Deploy to Server + uses: appleboy/ssh-action@v1.0.3 + with: + host: test.digitaldrilling.ru + username: asb + key: ${{ secrets.SSH_PRIVATE_KEY }} + port: 35222 + script: | + cd /home/asb/AsbCloudDeployTest/ + rsync -avzP --delete --exclude "backup" . ./backup \ No newline at end of file diff --git a/.gitea/workflows/unit-tests.yaml b/.gitea/workflows/unit-tests.yaml new file mode 100644 index 00000000..b17ae49c --- /dev/null +++ b/.gitea/workflows/unit-tests.yaml @@ -0,0 +1,23 @@ +name: Unit tests +run-name: ${{ gitea.actor }} is testing +on: + push: + branches: + - dev + pull_request: + types: [review_requested, ready_for_review] + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - name: Setup dotnet + if: ${{ steps.cache-dotnet.outputs.cache-hit != 'true' }} + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 6.0.x + - name: Check out repository code + uses: actions/checkout@v4 + - run: dotnet test AsbCloudWebApi.Tests + \ No newline at end of file diff --git a/AsbCloud.sln b/AsbCloud.sln index a33359b7..cbdae082 100644 --- a/AsbCloud.sln +++ b/AsbCloud.sln @@ -15,7 +15,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AsbCloudWebApi.Tests", "Asb EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SignalRTestClient", "SignalRTestClient\SignalRTestClient.csproj", "{E6B97963-4CEA-47B6-A0C8-625FFA9B7D69}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AsbCloudWebApi.IntegrationTests", "AsbCloudWebApi.IntegrationTests\AsbCloudWebApi.IntegrationTests.csproj", "{2A937DFD-8E78-4204-A6B9-F3195EAA5818}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AsbCloudWebApi.IntegrationTests", "AsbCloudWebApi.IntegrationTests\AsbCloudWebApi.IntegrationTests.csproj", "{2A937DFD-8E78-4204-A6B9-F3195EAA5818}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution