|
65 | 65 | workingDirectory: r-package/policytree
|
66 | 66 | displayName: Valgrind check
|
67 | 67 | condition: eq(variables['Agent.OS'], 'Linux')
|
68 |
| - # Final deploy step |
69 |
| - # Build the online docs and deploy to gh-pages - only done on master branch with Linux image. |
70 |
| - # `GITHUB_PAT` is a GitHub access token stored on Azure Pipelines. |
71 |
| - - script: | |
72 |
| - set -e |
73 |
| - sudo apt-get install -qq pandoc |
74 |
| - # Lock in a previous version of `pkgdown` and its dependencies. |
75 |
| - sudo Rscript -e "install.packages(c('fs', 'highlight', 'httr', 'memoise', 'openssl', 'purrr', 'rmarkdown', 'rstudioapi', 'whisker', 'xml2', 'yaml'))" |
76 |
| - sudo Rscript -e "install.packages('https://cran.r-project.org/src/contrib/Archive/pkgdown/pkgdown_1.5.1.tar.gz', repos = NULL, type = 'source')" |
77 |
| - # Install dependencies needed for vignettes. |
78 |
| - sudo Rscript -e "install.packages(c('DiagrammeR'))" |
79 |
| - cp ../../README.md . |
80 |
| - cp ../../releases/CHANGELOG.md . |
81 |
| - # Build and deploy page. This requires that the branch `gh-pages` exists. |
82 |
| - # git worktree is used to only commit the doc folder (docs/) as the root. |
83 |
| - # update-ref is used to not keep a commit history of the generated docs. |
84 |
| - git config --local user.email "azuredevops@microsoft.com" |
85 |
| - git config --local user.name "Azure Pipelines" |
86 |
| - git worktree add -B gh-pages docs/ origin/gh-pages |
87 |
| - rm -rf docs/* |
88 |
| - Rscript -e "pkgdown::build_site()" |
89 |
| - cd docs |
90 |
| - git add --all |
91 |
| - git update-ref -d refs/heads/gh-pages |
92 |
| - git commit --allow-empty -m "Update gh-pages ***NO_CI***" |
93 |
| - git push --force https://$(GITHUB_PAT)@github.com/grf-labs/policytree.git HEAD:gh-pages |
94 |
| - workingDirectory: r-package/policytree |
95 |
| - displayName: 'Publish GitHub Pages' |
96 |
| - condition: | |
97 |
| - and(eq(variables['Agent.OS'], 'Linux'), |
98 |
| - and(not(eq(variables['Build.Reason'], 'PullRequest')), |
99 |
| - eq(variables['Build.SourceBranch'], 'refs/heads/master'))) |
0 commit comments