parameters: dependsOn: [] jobs: - job: documentation displayName: 'Deploy API documentation' condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master')) pool: vmImage: 'Ubuntu 16.04' dependsOn: - ${{ parameters.dependsOn }} steps: - template: azure-install-rust.yml parameters: rust_version: ${{ parameters.rust }} - script: | cargo doc --no-deps --all-features cp -R target/doc '$(Build.BinariesDirectory)' env: RUSTDOCFLAGS: --cfg docsrs displayName: 'Generate documentation' - script: | set -e git --version ls -la git init git config user.name 'Deployment Bot (from Azure Pipelines)' git config user.email '<>' git config --global credential.helper 'store --file ~/.my-credentials' printf "protocol=https\nhost=github.com\nusername=rjsberry\npassword=%s\n\n" "$GITHUB_TOKEN" | git credential-store --file ~/.my-credentials store git remote add origin https://github.com/rjsberry/aktrs git checkout -b gh-pages git add . git commit -m 'Deploy aktrs API documentation' git push -f origin gh-pages env: GITHUB_TOKEN: $(githubPersonalToken) workingDirectory: '$(Build.BinariesDirectory)' displayName: 'Deploy documentation'