-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathazure-pipelines-docs.yml
81 lines (76 loc) · 2.22 KB
/
azure-pipelines-docs.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
pr:
- master
name: code documentation
trigger:
branches:
include:
- releases/*
exclude:
- master
pool:
vmImage: 'windows-latest'
variables:
solution: '*.sln'
builPdlatform: 'Any CPU'
buildConfiguration: 'Release'
DOCKER_DRIVER: overlay
jobs:
- job: docfx
steps:
- task: NuGetToolInstaller@1
- task: NuGetCommand@2
inputs:
restoreSolution: '$(solution)'
- task: CmdLine@2
displayName: 'download dependencies'
continueOnError: true
inputs:
script: |
curl -LO "https://github.com/dotnet/docfx/releases/download/v2.48/docfx.zip"
curl -LO "https://www.7-zip.org/a/7za920.zip"
curl -LO "https://downloads.wkhtmltopdf.org/0.12/0.12.5/wkhtmltox-0.12.5-1.mxe-cross-win64.7z"
echo | dir
# 7za920.exe x wkhtmltox-0.12.5-1.mxe-cross-win64.7z "-o wkhtmltox" -y
- task: ExtractFiles@1
displayName: 'install docfx cli'
continueOnError: true
inputs:
archiveFilePatterns: 'docfx.zip'
destinationFolder: docfx
- task: ExtractFiles@1
displayName: 'install 7zip cli'
continueOnError: true
inputs:
archiveFilePatterns: '7za920.zip'
destinationFolder: 7zip
- task: CmdLine@2
displayName: 'generate docs'
continueOnError: true
inputs:
script: |
.\docfx\docfx.exe
# - task: CmdLine@2
# displayName: 'generate docs as pdf'
# continueOnError: true
# inputs:
# script: |
# .\7zip\7za.exe x wkhtmltox-0.12.5-1.mxe-cross-win64.7z "-odocfx_pdf" -y
# echo | dir
# echo | dir docfx_pdf
# set PATH=%PATH%;docfx_pdf\wkhtmltox\bin
# .\docfx\docfx.exe .\docfx_pdf.json
# may need to use environment variable to select path
- task: PublishBuildArtifacts@1
displayName: 'save html docs'
continueOnError: true
inputs:
PathtoPublish: '_site'
ArtifactName: 'code_docs'
publishLocation: 'Container'
# - task: PublishBuildArtifacts@1
# displayName: 'save pdf docs'
# continueOnError: true
# inputs:
# PathtoPublish: '_site_pdf'
# ArtifactName: 'code_docs'
# publishLocation: 'Container'