Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 30 additions & 7 deletions .ci/azure/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,17 @@ jobs:
displayName: "Deploy Docs and source"
pool:
vmImage: ubuntu-latest

steps:
# No need to checkout the repo here!
- checkout: none

- bash: |
echo $IS_TAG
echo $IS_MAIN
echo $BRANCH_NAME
displayName: Report branch parameters

# Just download all of the items already built
- task: DownloadPipelineArtifact@2
inputs:
Expand All @@ -29,6 +36,7 @@ jobs:
- bash: |
ls -l dist
ls -l html
displayName: Report downloaded cache contents.

- bash: |
git config --global user.name ${GH_NAME}
Expand All @@ -42,22 +50,37 @@ jobs:
- bash: |
twine upload --skip-existing dist/*
displayName: Deploy source and wheels
condition: eq(variables.IS_TAG, true)
env:
TWINE_USERNAME: $(twine.username)
TWINE_PASSWORD: $(twine.password)

# upload documentation to discretize-docs gh-pages on tags
- bash: |
git clone --depth 1 https://${GH_TOKEN}@github.com/simpeg/discretize-docs.git
git clone -q --branch gh-pages --depth 1 https://${GH_TOKEN}@github.com/simpeg/discretize-docs.git
displayName: Checkout doc repository

- bash: |
cd discretize-docs
git gc --prune=now
git remote prune origin
rm -rf en/main/*
cp -r html/* en/main/
rm -rf "en/$BRANCH_NAME"
mv ../html "en/$BRANCH_NAME"
touch .nojekyll
git add .
displayName: Set Doc Folder

- bash:
# Update latest symlink
cd discretize-docs
rm -f en/latest
ln -s "en/$BRANCH_NAME" en/latest
displayName: Point Latest to tag
condition: eq(variables.IS_TAG, true)

- bash:
# Commit and push
cd discretize-docs
git add --all
git commit -am "Azure CI commit ref $(Build.SourceVersion)"
git push
displayName: Push documentation to discretize-docs
env:
GH_TOKEN: $(gh.token)
GH_TOKEN: $(gh.token)
4 changes: 2 additions & 2 deletions .ci/azure/docs.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
jobs:
- job:
- job: BuildDocs
displayName: "Build Documentation"
pool:
vmImage: ubuntu-latest
Expand Down Expand Up @@ -33,4 +33,4 @@ jobs:
inputs:
targetPath: 'docs/_build/html'
artifact: 'html_docs'
parallel: true
parallel: true
7 changes: 6 additions & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ pr:
exclude:
- '*no-ci*'

variables:
BRANCH_NAME: $(Build.SourceBranchName)
IS_TAG: $[startsWith(variables['Build.SourceBranch'], 'refs/tags/')]
IS_MAIN: $[eq(variables['Build.SourceBranch'], 'refs/heads/main')]

stages:
- stage: StyleChecks
displayName: "Style Checks"
Expand Down Expand Up @@ -52,7 +57,7 @@ stages:
dependsOn:
- BuildWheels
- BuildSource
condition: and(succeeded(), startsWith(variables['build.sourceBranch'], 'refs/tags/'))
condition: and(succeeded(), or(eq(variables.IS_TAG, true), eq(variables.IS_MAIN, true)))
jobs:
- template: .ci/azure/deploy.yml

Expand Down