-
Notifications
You must be signed in to change notification settings - Fork 30
/
azure-pipelines.yml
45 lines (37 loc) · 1.42 KB
/
azure-pipelines.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
# Publish the docs to GitHub pages
# we only build and publish when changes ocurr to the master branch
trigger:
- master
pool:
vmImage: 'Ubuntu-16.04'
steps:
# https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema?view=azdevops&tabs=schema#checkout
- checkout: self
persistCredentials: true # set to 'true' to leave the OAuth token in the Git config after the initial fetch
- task: UsePythonVersion@0
inputs:
versionSpec: '3.7'
addToPath: true
displayName: 'Using defined Python version'
- script: |
python -m pip install --upgrade pip pipenv
pipenv install --dev --system --deploy
displayName: 'Install dependencies via Pipfile'
- script: |
sphinx-build -n -b html ./source $(Build.ArtifactStagingDirectory)/build/html
displayName: 'Building Sphinx docs'
- script: |
git config --local user.name "Tania Allard"
git config --local user.email "trallard@bitsandchips.me"
cp -a $(Build.ArtifactStagingDirectory)/build/html/ $(Build.Repository.LocalPath)/docs
rm -rf $(Build.Repository.LocalPath)/docs/html/.doctrees
displayName: 'Copy artifacts to clean branch'
- script: |
cd $(Build.Repository.LocalPath)
git add --all
git commit -m "Build documentation [skip ci]"
git push origin HEAD:master
displayName: 'Publish GitHub Pages'
condition: |
and(not(eq(variables['Build.Reason'], 'PullRequest')),
eq(variables['Build.SourceBranch'], 'refs/heads/master'))