diff --git a/.github/workflows/azure-pipelines_pxcloud2.yml b/.github/workflows/azure-pipelines_pxcloud2.yml new file mode 100644 index 000000000..0755f983f --- /dev/null +++ b/.github/workflows/azure-pipelines_pxcloud2.yml @@ -0,0 +1,57 @@ +# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy +# More GitHub Actions for Azure: https://github.com/Azure/actions + +name: Build and deploy to PXCloud2 + +on: + push: + branches: + - azure-pipelines + workflow_dispatch: + +jobs: + build: + runs-on: windows-latest + + steps: + - uses: actions/checkout@v2 + + - name: Setup MSBuild path + uses: microsoft/setup-msbuild@v1.0.2 + + - name: Setup NuGet + uses: NuGet/setup-nuget@v1.0.5 + + - name: Restore NuGet packages + run: nuget restore PCAxis.PX-Web.sln + + - name: Publish to folder + run: msbuild PCAxis.PX-Web.sln /nologo /verbosity:m /p:DeployOnBuild=TRUE /p:_PackageTempDir="\published\" + + - name: Upload artifact for deployment job + uses: actions/upload-artifact@v2 + with: + name: ASP-app + path: '/published/**' + + deploy: + runs-on: windows-latest + needs: build + environment: + name: 'Production' + url: ${{ steps.deploy-to-webapp.outputs.webapp-url }} + + steps: + - name: Download artifact from build job + uses: actions/download-artifact@v2 + with: + name: ASP-app + + - name: Deploy to Azure Web App + id: deploy-to-webapp + uses: azure/webapps-deploy@v2 + with: + app-name: 'PXCloud2' + slot-name: 'Production' + publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_0C291CE2EEA14BC2BB5F6A6972930634 }} + package: . diff --git a/.github/workflows/buildOnPullRequest.yml b/.github/workflows/buildOnPullRequest.yml deleted file mode 100644 index 6664b3bd7..000000000 --- a/.github/workflows/buildOnPullRequest.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: .NET - -on: - pull_request: - branches: [ master ] - -jobs: - build: - - runs-on: [windows-latest] - - steps: - - uses: actions/checkout@v2 - - - name: setup-msbuild - uses: microsoft/setup-msbuild@v1 - - - name: Setup NuGet - uses: NuGet/setup-nuget@v1.0.5 - - - name: Restore Nuget Packages - run: nuget restore PCAxis.PX-Web.sln - - - name: Build the solution - run: msbuild PCAxis.PX-Web.sln - diff --git a/.github/workflows/msbuild.yml b/.github/workflows/msbuild.yml deleted file mode 100644 index 90b74e82a..000000000 --- a/.github/workflows/msbuild.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: MSBuild - -on: push - -jobs: - build: - - runs-on: windows-2019 - - strategy: - matrix: - configuration: [Debug, Release] - - steps: - - - uses: actions/checkout@v2 - - - uses: microsoft/setup-msbuild@v1 - - - uses: NuGet/setup-nuget@v1 - - - name: Restore NuGet packages - run: nuget restore - - - name: Build the application - run: msbuild /p:Configuration=$env:Configuration - env: - Configuration: ${{ matrix.configuration }} diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 000000000..6f302fa06 --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,34 @@ +# ASP.NET +# Build and test ASP.NET projects. +# Add steps that publish symbols, save build artifacts, deploy, and more: +# https://docs.microsoft.com/azure/devops/pipelines/apps/aspnet/build-aspnet-4 + +trigger: +- azure-pipelines + +pool: + vmImage: 'windows-latest' + +variables: + solution: 'PCAxis.PX-Web.sln' + buildPlatform: 'Any CPU' + buildConfiguration: 'Release' + +steps: +- task: NuGetToolInstaller@1 + +- task: NuGetCommand@2 + inputs: + restoreSolution: '$(solution)' + +- task: VSBuild@1 + inputs: + solution: '$(solution)' + msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="$(build.artifactStagingDirectory)"' + platform: '$(buildPlatform)' + configuration: '$(buildConfiguration)' + +- task: VSTest@2 + inputs: + platform: '$(buildPlatform)' + configuration: '$(buildConfiguration)'