Skip to content

Commit

Permalink
Edit tag determiner for docs, now latest or version.
Browse files Browse the repository at this point in the history
  • Loading branch information
thijsmie committed May 14, 2021
1 parent 8b8ce7f commit 7c8948e
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions .azure/build-documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ trigger:
- '*'
branches:
include:
- '*'
- 'master'

pool:
vmImage: ubuntu-20.04
Expand Down Expand Up @@ -67,14 +67,23 @@ steps:
git clone [email protected]:thijsmie/cddstemp.github.io.git documentation-repo
name: get_site_repo
displayName: Pull documentation repo
- script: |
- bash: |
set -e -x
if [ "$(Build.SourceBranchName)" = "master" ]; then
echo "###vso[task.setvariable variable=docs_tag;]latest"
else
echo "###vso[task.setvariable variable=docs_tag;]$(echo '$(Build.SourceBranchName)' | grep -Eo '^[[:digit:]]\.[[:digit:]]\.[[:digit:]]')"
fi
name: "determine_docu_tag"
displayName: Determine the documentation version number
- bash: |
set -e -x
rm -rf "documentation-repo/docs/c/$(Build.SourceBranchName)" || true
cp -R "build/docs/docs" "documentation-repo/docs/c/$(Build.SourceBranchName)"
rm -rf "documentation-repo/docs/c/${DOCS_TAG}" || true
cp -R "build/docs/docs" "documentation-repo/docs/c/${DOCS_TAG})"
cd documentation-repo
git add "docs/c/$(Build.SourceBranchName)"
git config --local user.name "Azure Pipelines"
git config --local user.email "[email protected]"
(git commit -m "Publishing GitHub Pages $(Build.SourceVersion)" && git push -f origin HEAD:master) || true
(git commit -m "Publishing GitHub Pages ${DOCS_TAG}" && git push origin HEAD:master) || true
name: 'commit_pages'
displayName: Commit new documentation into repo

0 comments on commit 7c8948e

Please sign in to comment.