Files
Shogi/azure-pipelines.yml
2026-01-15 20:06:16 -06:00

61 lines
1.4 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'
projectName: 'Shogi'
steps:
- task: NuGetToolInstaller@1
- task: UseDotNet@2
inputs:
packageType: sdk
version: 10.x
installationPath: $(Agent.ToolsDirectory)/dotnet
- task: NuGetCommand@2
inputs:
restoreSolution: '$(solution)'
- task: FileTransform@1
inputs:
folderPath: '$(System.DefaultWorkingDirectory)\$(projectName)'
fileType: 'json'
targetFiles: 'appsettings.json'
- task: DotNetCoreCLI@2
inputs:
command: 'publish'
publishWebProjects: false
projects: '$(projectName)/$(projectName).csproj'
arguments: '-c Release -o $(Build.ArtifactStagingDirectory)'
zipAfterPublish: false
- task: CopyFilesOverSSH@0
displayName: "Copy application files"
inputs:
sshEndpoint: 'LucaServer'
sourceFolder: '$(Build.ArtifactStagingDirectory)'
contents: '**'
targetFolder: '/var/www/apps/$(projectName)'
readyTimeout: '20000'
- task: SSH@0
displayName: "Restart Kestrel"
inputs:
sshEndpoint: 'LucaServer'
runOptions: 'commands'
commands: 'sudo systemctl restart kestrel-Shogi.service'
readyTimeout: '20000'