11jobs :
22- job :
3- displayName : " Deploy Docs and source "
3+ displayName : " Deploy Docs"
44 pool :
55 vmImage : ubuntu-latest
6+
67 steps :
78 # No need to checkout the repo here!
89 - checkout : none
910
10- # Just download all of the items already built
11- - task : DownloadPipelineArtifact@2
12- inputs :
13- buildType : ' current'
14- artifactName : ' wheels'
15- targetPath : ' dist'
16-
17- - task : DownloadPipelineArtifact@2
18- inputs :
19- buildType : ' current'
20- artifactName : ' source_dist'
21- targetPath : ' dist'
11+ - bash : |
12+ echo $IS_TAG
13+ echo $IS_MAIN
14+ echo $BRANCH_NAME
15+ displayName: Report branch parameters
2216
2317 - task : DownloadPipelineArtifact@2
2418 inputs :
2721 targetPath : ' html'
2822
2923 - bash : |
30- ls -l dist
3124 ls -l html
25+ displayName: Report downloaded cache contents.
3226
3327 - bash : |
3428 git config --global user.name ${GH_NAME}
@@ -39,25 +33,34 @@ jobs:
3933 GH_NAME: $(gh.name)
4034 GH_EMAIL: $(gh.email)
4135
36+ # upload documentation to discretize-docs gh-pages on tags
4237 - bash : |
43- twine upload --skip-existing dist/*
44- displayName: Deploy source and wheels
38+ git clone -q --branch gh-pages --depth 1 https://${GH_TOKEN}@github.com/simpeg/discretize-docs.git
39+ displayName: Checkout doc repository
4540 env:
46- TWINE_USERNAME: $(twine.username)
47- TWINE_PASSWORD: $(twine.password)
41+ GH_TOKEN: $(gh.token)
4842
49- # upload documentation to discretize-docs gh-pages on tags
5043 - bash : |
51- git clone --depth 1 https://${GH_TOKEN}@github.com/simpeg/discretize-docs.git
5244 cd discretize-docs
53- git gc --prune=now
54- git remote prune origin
55- rm -rf en/main/*
56- cp -r html/* en/main/
45+ rm -rf "en/$BRANCH_NAME"
46+ mv ../html "en/$BRANCH_NAME"
5747 touch .nojekyll
58- git add .
48+ displayName: Set Doc Folder
49+
50+ - bash : |
51+ # Update latest symlink
52+ cd discretize-docs
53+ rm -f en/latest
54+ ln -s "en/$BRANCH_NAME" en/latest
55+ displayName: Point Latest to tag
56+ condition: eq(variables.IS_TAG, true)
57+
58+ - bash : |
59+ # Commit and push
60+ cd discretize-docs
61+ git add --all
5962 git commit -am "Azure CI commit ref $(Build.SourceVersion)"
6063 git push
6164 displayName: Push documentation to discretize-docs
6265 env:
63- GH_TOKEN: $(gh.token)
66+ GH_TOKEN: $(gh.token)
0 commit comments