deploy-docs.yml 1.36 KB
Newer Older
1
2
queue:
  name: Hosted Ubuntu 1604
Gao, Xiang's avatar
Gao, Xiang committed
3
  timeoutInMinutes: 6000
4
5
6
7

variables:
  python.version: '3.7'

Gao, Xiang's avatar
Gao, Xiang committed
8
9
10
11
12
13
14
15
trigger:
  batch: true
  branches:
    include:
    - master

pr: none

16
17
18
19
20
21
22
steps:

- task: UsePythonVersion@0
  displayName: 'Use Python $(python.version)'
  inputs:
    versionSpec: '$(python.version)'

Gao, Xiang's avatar
Gao, Xiang committed
23
24
25
- script: 'git describe --exact-match --tags HEAD'
  displayName: 'Fail build on non-release commits'

26
- script: 'azure/install_dependencies.sh && pip install h5py pytorch-ignite-nightly tb-nightly sphinx sphinx_rtd_theme matplotlib pillow sphinx-gallery && pip install .'
27
28
29
30
31
  displayName: 'Install dependencies'

- script: 'sphinx-build docs build'
  displayName: Build documents

Gao, Xiang's avatar
Gao, Xiang committed
32
- script: 'mkdir -p ~/.ssh && echo $(deploy_privatekey) | base64 -d > ~/.ssh/id_rsa && chmod 0600 ~/.ssh/id_rsa && echo $(deploy_pubkey) > ~/.ssh/id_rsa.pub'
33
34
  displayName: Set up deploy keys

Gao, Xiang's avatar
Gao, Xiang committed
35
36
37
38
39
- script: 'ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts && git config --global user.email "zasdfgbnm-bot@example.com" && git config --global user.name "zasdfgbnm-bot"'
  displayName: Set up github

- script: 'git clone git@github.com:aiqm/torchani.git deploy_dir -b gh-pages'
  displayName: Clone gh-pages repository
40
41

- script: 'rm -rf deploy_dir/* && cp -r build/* deploy_dir'
Gao, Xiang's avatar
Gao, Xiang committed
42
  displayName: Replace with new files
43
44
45

- script: 'cd deploy_dir && git add . && git commit -m "update" && git push'
  displayName: Deploy