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: platform: ${{parameters.name}} rust_version: stable - script: | cargo doc --all --no-deps cp -R target/doc '$(Build.BinariesDirectory)' 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 'deploy@tower-rs.com' git config --global credential.helper 'store --file ~/.my-credentials' printf "protocol=https\nhost=github.com\nusername=carllerche\npassword=%s\n\n" "$GITHUB_TOKEN" | git credential-store --file ~/.my-credentials store git remote add origin https://github.com/tower-rs/tower git checkout -b gh-pages git add . git commit -m 'Deploy Tower API documentation' git push -f origin gh-pages env: GITHUB_TOKEN: $(githubPersonalToken) workingDirectory: '$(Build.BinariesDirectory)' displayName: 'Deploy Documentation'