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