...
1jobs:
2 - job: CreateDocIndex
3 pool:
4 vmImage: windows-2019
5 steps:
6 - task: UsePythonVersion@0
7 displayName: 'Use Python 3.6'
8 inputs:
9 versionSpec: '3.6'
10
11 - pwsh: |
12 Invoke-WebRequest -Uri "https://github.com/dotnet/docfx/releases/download/v2.43.2/docfx.zip" `
13 -OutFile "docfx.zip" | Wait-Process; Expand-Archive -Path "docfx.zip" -DestinationPath ./docfx
14 echo "##vso[task.setvariable variable=docfxPath]$(Build.BinariesDirectory)/docfx/docfx.exe"
15 workingDirectory: $(Build.BinariesDirectory)
16 displayName: Download and Extract DocFX
17
18 - task: PowerShell@2
19 displayName: 'Generate Doc Index'
20 inputs:
21 pwsh: true
22 filePath: $(Build.SourcesDirectory)/eng/common/docgeneration/Generate-DocIndex.ps1
23 arguments: >
24 -Docfx $(docfxPath)
25 -RepoRoot $(Build.SourcesDirectory)
26 -DocGenDir "$(Build.SourcesDirectory)/eng/common/docgeneration"
27 -DocOutDir "$(Build.ArtifactStagingDirectory)/docfx_project"
28 -verbose
29
30 - task: UsePythonVersion@0
31 displayName: 'Use Python 3.6'
32 inputs:
33 versionSpec: '3.6'
34 - template: /eng/common/pipelines/templates/steps/mashup-doc-index.yml
35 parameters:
36 SourceDirectory: $(Build.ArtifactStagingDirectory)
37 - pwsh: |
38 Copy-Item -Path $(Build.SourcesDirectory)/eng/* -Destination ./ -Recurse -Force
39 echo "##vso[task.setvariable variable=toolPath]$(Build.BinariesDirectory)"
40 workingDirectory: $(Build.BinariesDirectory)
41 displayName: Move eng/common to Tool Directory
42
43 - task: PublishPipelineArtifact@0
44 condition: succeeded()
45 inputs:
46 artifactName: "Doc.Index"
47 targetPath: $(Build.ArtifactStagingDirectory)/docfx_project/_site
48
49 - pwsh: |
50 git checkout -b gh-pages-local --track origin/gh-pages-root -f
51 workingDirectory: $(Build.SourcesDirectory)
52 displayName: Git pull GH pages branch
53
54 - pwsh: |
55 Copy-Item -Path $(Build.ArtifactStagingDirectory)/docfx_project/_site/* -Destination ./ -Recurse -Force
56 git add -A
57 workingDirectory: $(Build.SourcesDirectory)
58 displayName: Copy the latest changes
59
60 - task: PowerShell@2
61 displayName: Push the Docs to GH-Pages
62 condition: succeeded()
63 inputs:
64 pwsh: true
65 workingDirectory: $(Build.SourcesDirectory)
66 filePath: $(toolPath)/common/scripts/git-branch-push.ps1
67 arguments: >
68 -PRBranchName "gh-pages"
69 -CommitMsg "Auto-generated docs from SHA(s) $(Build.SourceVersion)"
70 -GitUrl "https://$(azuresdk-github-pat)@github.com/$(Build.Repository.Name).git"
71 -PushArgs "--force"
View as plain text