-
Notifications
You must be signed in to change notification settings - Fork 19
/
documentation-build.yml
55 lines (47 loc) · 1.67 KB
/
documentation-build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
###########################################################################
# This is a sample Azure DevOps pipeline that can be used for generating
# a documentation website using DocFX. In this pipeline we use the
# DocFxTocGenerator tool to generate the table of contents.
###########################################################################
trigger:
- none
variables:
- name: AzureConnectionName
value: '<Azure connection name from ADO>'
pool:
vmImage: windows-latest
steps:
# install docfx
- powershell: choco install docfx -y
displayName: Install docfx
# install the companion tools
- powershell: choco install docfx-companion-tools -y
displayName: Install docfx companion tools
# run the toc generator on /DocExamample folder
- powershell: DocFxTocGenerator -d .\DocExamples -si
displayName: 'Generating TOC for .\DocExamples'
# run docfx to generate documentation website
- powershell: |
&docfx DocEample\docfx.json
if ($lastexitcode -ne 0)
{
throw [System.Exception] "docfx build failed with exit code $lastexitcode."
}
condition: succeeded()
displayName: Run docfx
# Create an archive
- task: ArchiveFiles@2
displayName: 'Packing Documentation Web Site'
inputs:
rootFolderOrFile: '$(System.DefaultWorkingDirectory)/_site'
includeRootFolder: false
archiveType: 'zip'
archiveFile: '$(Build.ArtifactStagingDirectory)/site.zip'
replaceExistingArchive: true
# deployment to Azure
- task: AzureRmWebAppDeployment@4
displayName: 'Publish website to Azure App Service'
inputs:
azureSubscription: $(AzureConnectionName)
WebAppName: docs-website
packageForLinux: '$(Build.ArtifactStagingDirectory)/site.zip'