forked from simpeg/simpeg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
92 lines (84 loc) · 2.72 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
trigger:
branches:
include:
- '*'
exclude:
- '*no-ci*'
tags:
include:
- '*'
pr:
branches:
include:
- '*'
exclude:
- '*no-ci*'
stages:
- stage: Testing
jobs:
- template: ./.azure-pipelines/matrix.yml
- stage: Deploy
condition: and(succeeded(), startsWith(variables['build.sourceBranch'], 'refs/tags/'))
jobs:
- job:
displayName: Deploy Docs and source
pool:
vmImage: ubuntu-latest
variables:
python.version: '3.7'
timeoutInMinutes: 120
steps:
- script: |
git config --global user.name ${GH_NAME}
git config --global user.email ${GH_EMAIL}
git config --list | grep user.
displayName: 'Configure git'
env:
GH_NAME: $(gh.name)
GH_EMAIL: $(gh.email)
- script: echo '##vso[task.prependpath]$CONDA/bin'
displayName: Add conda to PATH
- script: conda create --yes --quiet --name deploy python=$(python.version) pip
displayName: Create Anaconda environment
- script: |
eval "$(conda shell.bash hook)"
conda activate deploy
conda install --yes --quiet numpy scipy matplotlib ipython h5py
conda install --yes -c conda-forge discretize empymod geoana properties vectormath pandas dask zarr fsspec python-kaleido
pip install -r requirements_dev.txt
pip install -e .
displayName: Install requirements and build
- script: |
eval "$(conda shell.bash hook)"
conda activate deploy
python setup.py sdist
twine upload --skip-existing dist/*
displayName: Deploy source
env:
TWINE_USERNAME: $(twine.username)
TWINE_PASSWORD: $(twine.password)
- script: |
eval "$(conda shell.bash hook)"
conda activate deploy
export KMP_WARNINGS=0
cd docs
make html
cd ..
displayName: Building documentation
# upload documentation to simpeg-docs gh-pages on tags
- script: |
git clone --depth 1 https://${GH_TOKEN}@github.com/simpeg/simpeg-docs.git
cd simpeg-docs
git gc --prune=now
git remote prune origin
rm -rf *
cp -r $BUILD_SOURCESDIRECTORY/docs/_build/html/* .
cp $BUILD_SOURCESDIRECTORY/docs/README.md .
touch .nojekyll
echo "docs.simpeg.xyz" >> CNAME
git add .
git commit -am "Azure CI commit ref $(Build.SourceVersion)"
git push
displayName: Push documentation to simpeg-docs
env:
GH_TOKEN: $(gh.token)