Files
Shogi/azure-pipelines.yml
2023-01-14 16:51:38 +00:00

64 lines
1.6 KiB
YAML

# 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:
- master
pool:
vmImage: 'windows-latest'
variables:
solution: '**/*.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
apiProjectName: 'Shogi.Api'
uiProjectName: 'Shogi.UI'
steps:
- task: NuGetToolInstaller@1
- task: NuGetCommand@2
inputs:
restoreSolution: '$(solution)'
- task: FileTransform@1
inputs:
folderPath: '$(System.DefaultWorkingDirectory)\$(uiProjectName)'
fileType: 'json'
targetFiles: 'wwwroot/appsettings.json'
- task: DotNetCoreCLI@2
inputs:
command: 'publish'
publishWebProjects: false
arguments: '-c Release'
zipAfterPublish: false
- task: CopyFilesOverSSH@0
displayName: "Copy API files."
inputs:
sshEndpoint: 'LucaServer'
sourceFolder: '$(System.DefaultWorkingDirectory)/$(apiProjectName)/bin/Release/net6.0/publish'
contents: '**'
targetFolder: '/var/www/apps/$(apiProjectName)'
readyTimeout: '20000'
- task: CopyFilesOverSSH@0
displayName: "Copy UI files."
inputs:
sshEndpoint: 'LucaServer'
sourceFolder: '$(System.DefaultWorkingDirectory)/$(uiProjectName)/bin/Release/net6.0/publish'
contents: '**'
targetFolder: '/var/www/apps/$(uiProjectName)'
readyTimeout: '20000'
- task: SSH@0
displayName: "Restart Kestrel"
inputs:
sshEndpoint: 'LucaServer'
runOptions: 'commands'
commands: 'sudo systemctl restart kestrel-shogi.api.service'
readyTimeout: '20000'