2019-05-31 19:42:23 +03:00
|
|
|
trigger:
|
2020-03-26 18:30:06 +03:00
|
|
|
batch: true
|
|
|
|
branches:
|
|
|
|
include:
|
|
|
|
- master
|
2020-06-26 14:57:06 +03:00
|
|
|
- 'refs/tags/ccf-*'
|
2019-05-31 19:42:23 +03:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
- job: build_and_publish_docs
|
2020-10-29 14:59:23 +03:00
|
|
|
container: ccfciteam/ccf-ci:oe0.12.0
|
2020-03-26 18:30:06 +03:00
|
|
|
pool:
|
|
|
|
vmImage: ubuntu-18.04
|
2019-10-31 16:38:17 +03:00
|
|
|
|
2019-05-31 19:42:23 +03:00
|
|
|
steps:
|
|
|
|
- checkout: self
|
|
|
|
clean: true
|
|
|
|
|
2020-05-01 10:36:54 +03:00
|
|
|
- script: |
|
2020-07-24 18:19:32 +03:00
|
|
|
env
|
|
|
|
git status
|
|
|
|
git rev-parse HEAD
|
2020-07-24 19:50:01 +03:00
|
|
|
git checkout -b master $(git rev-parse HEAD)
|
2020-05-01 10:36:54 +03:00
|
|
|
displayName: Prepare repo
|
2019-05-31 19:42:23 +03:00
|
|
|
|
2020-08-10 14:07:14 +03:00
|
|
|
# Used to generate setup.py
|
|
|
|
- template: .azure-pipelines-templates/cmake.yml
|
|
|
|
parameters:
|
|
|
|
cmake_args: ''
|
|
|
|
|
2019-05-31 19:42:23 +03:00
|
|
|
- script: |
|
2020-09-11 18:33:09 +03:00
|
|
|
python3.8 -m venv env
|
2019-05-31 19:42:23 +03:00
|
|
|
source env/bin/activate
|
2019-06-27 15:45:28 +03:00
|
|
|
pip install wheel
|
2020-05-06 15:01:24 +03:00
|
|
|
pip install -U -r doc/requirements.txt
|
2020-07-27 19:34:16 +03:00
|
|
|
pip install -U -e ./python
|
2020-04-30 23:48:29 +03:00
|
|
|
sphinx-multiversion doc build/html
|
2019-05-31 19:42:23 +03:00
|
|
|
displayName: Sphinx
|
|
|
|
|
|
|
|
- script: |
|
|
|
|
git init
|
|
|
|
git config --local user.name "Azure Pipelines"
|
|
|
|
git config --local user.email "azuredevops@microsoft.com"
|
|
|
|
git add .
|
2020-05-01 10:55:53 +03:00
|
|
|
touch .nojekyll
|
|
|
|
git add .nojekyll
|
2020-05-01 12:02:19 +03:00
|
|
|
cp ../../doc/index.html .
|
|
|
|
git add index.html
|
2019-05-31 19:42:23 +03:00
|
|
|
git commit -m "[ci skip] commit generated documentation"
|
|
|
|
displayName: 'Commit pages'
|
2020-04-30 23:48:29 +03:00
|
|
|
workingDirectory: build/html
|
2019-05-31 19:42:23 +03:00
|
|
|
|
|
|
|
- task: DownloadSecureFile@1
|
|
|
|
inputs:
|
|
|
|
secureFile: ccf
|
|
|
|
displayName: 'Get the deploy key'
|
|
|
|
|
|
|
|
- script: |
|
|
|
|
mv $DOWNLOADSECUREFILE_SECUREFILEPATH deploy_key
|
|
|
|
chmod 600 deploy_key
|
2019-10-31 19:53:00 +03:00
|
|
|
mkdir ~/.ssh
|
|
|
|
chmod 700 ~/.ssh
|
2019-05-31 19:42:23 +03:00
|
|
|
ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts
|
|
|
|
git remote add origin git@github.com:microsoft/CCF.git
|
2019-05-31 19:48:38 +03:00
|
|
|
GIT_SSH_COMMAND="ssh -i deploy_key" git push -f origin HEAD:gh-pages
|
2019-05-31 19:42:23 +03:00
|
|
|
displayName: 'Publish GitHub Pages'
|
|
|
|
condition: |
|
|
|
|
and(not(eq(variables['Build.Reason'], 'PullRequest')),
|
|
|
|
eq(variables['Build.SourceBranch'], 'refs/heads/master'))
|
2020-04-30 23:48:29 +03:00
|
|
|
workingDirectory: build/html
|
2019-05-31 19:42:23 +03:00
|
|
|
|
|
|
|
- script: rm deploy_key || true
|
|
|
|
displayName: 'Make sure key is removed'
|
2020-04-30 23:48:29 +03:00
|
|
|
workingDirectory: build/html
|
2020-02-25 16:08:15 +03:00
|
|
|
condition: always()
|