forked from microsoft/CCF
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vsts-gh-pages.yml
52 lines (45 loc) · 1.5 KB
/
.vsts-gh-pages.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
trigger:
- master
jobs:
- job: build_and_publish_docs
pool: Ubuntu-1804-SGX-Azure
steps:
- checkout: self
clean: true
submodules: true
- script: doxygen
displayName: Doxgen
- script: |
python3.7 -m venv env
source env/bin/activate
pip install -U -r requirements.txt
make html
displayName: Sphinx
workingDirectory: sphinx
- script: |
git init
git config --local user.name "Azure Pipelines"
git config --local user.email "[email protected]"
git add .
git commit -m "[ci skip] commit generated documentation"
displayName: 'Commit pages'
workingDirectory: sphinx/build/html
- task: DownloadSecureFile@1
inputs:
secureFile: ccf
displayName: 'Get the deploy key'
- script: |
mv $DOWNLOADSECUREFILE_SECUREFILEPATH deploy_key
chmod 600 deploy_key
ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts
git remote add origin [email protected]:microsoft/CCF.git
GIT_SSH_COMMAND="ssh -i deploy_key" git push -f origin HEAD:gh-pages
displayName: 'Publish GitHub Pages'
condition: |
and(not(eq(variables['Build.Reason'], 'PullRequest')),
eq(variables['Build.SourceBranch'], 'refs/heads/master'))
workingDirectory: sphinx/build/html
- script: rm deploy_key || true
displayName: 'Make sure key is removed'
workingDirectory: sphinx/build/html
condition: succeededOrFailed()