33 displayName : " Deploy Docs and source"
44 pool :
55 vmImage : ubuntu-latest
6+
67 steps :
78 # No need to checkout the repo here!
89 - checkout : none
910
11+ - bash : |
12+ echo $IS_TAG
13+ echo $IS_MAIN
14+ echo $BRANCH_NAME
15+ displayName: Report branch parameters
16+
1017 # Just download all of the items already built
1118 - task : DownloadPipelineArtifact@2
1219 inputs :
2936 - bash : |
3037 ls -l dist
3138 ls -l html
39+ displayName: Report downloaded cache contents.
3240
3341 - bash : |
3442 git config --global user.name ${GH_NAME}
@@ -42,22 +50,39 @@ jobs:
4250 - bash : |
4351 twine upload --skip-existing dist/*
4452 displayName: Deploy source and wheels
53+ condition: eq(variables.IS_TAG, true)
4554 env:
4655 TWINE_USERNAME: $(twine.username)
4756 TWINE_PASSWORD: $(twine.password)
4857
4958 # upload documentation to discretize-docs gh-pages on tags
5059 - bash : |
51- git clone --depth 1 https://${GH_TOKEN}@github.com/simpeg/discretize-docs.git
60+ git clone -q --branch gh-pages --depth 1 https://${GH_TOKEN}@github.com/simpeg/discretize-docs.git
61+ displayName: Checkout doc repository
62+ env:
63+ GH_TOKEN: $(gh.token)
64+
65+ - bash : |
5266 cd discretize-docs
53- git gc --prune=now
54- git remote prune origin
55- rm -rf en/main/*
56- cp -r html/* en/main/
67+ rm -rf "en/$BRANCH_NAME"
68+ mv ../html "en/$BRANCH_NAME"
5769 touch .nojekyll
58- git add .
70+ displayName: Set Doc Folder
71+
72+ - bash : |
73+ # Update latest symlink
74+ cd discretize-docs
75+ rm -f en/latest
76+ ln -s "en/$BRANCH_NAME" en/latest
77+ displayName: Point Latest to tag
78+ condition: eq(variables.IS_TAG, true)
79+
80+ - bash : |
81+ # Commit and push
82+ cd discretize-docs
83+ git add --all
5984 git commit -am "Azure CI commit ref $(Build.SourceVersion)"
6085 git push
6186 displayName: Push documentation to discretize-docs
6287 env:
63- GH_TOKEN: $(gh.token)
88+ GH_TOKEN: $(gh.token)
0 commit comments