55 branches :
66 - master
77 - develop
8-
98 tags :
109 - ' *'
11-
1210 pull_request :
11+ merge_group :
12+ workflow_dispatch :
1313
1414jobs :
1515 bookdown :
@@ -18,48 +18,53 @@ jobs:
1818 GITHUB_PAT : ${{ secrets.GITHUB_TOKEN }}
1919
2020 container :
21- image : pecan/depends:R4.0.3
21+ image : pecan/depends:R4.1
2222
2323 steps :
2424 # checkout source code
25- - uses : actions/checkout@v2
26- # install rmarkdown
27- - name : Install rmarkdown
25+ - uses : actions/checkout@v4
26+ # install bookdown
27+ - name : Install bookdown
2828 run : |
29- Rscript -e 'install.packages(c("rmarkdown","bookdown"))'
29+ Rscript \
30+ -e 'repos <- c(getOption("repos"), sub(r"(\d{4}-\d{2}-\d{2})", "latest", getOption("repos")))' \
31+ -e 'remotes::install_version("bookdown", ">= 0.31", dependencies = TRUE, upgrade = FALSE, repos = repos)'
3032 # copy files
3133 - name : copy extfiles
3234 run : |
3335 mkdir -p book_source/extfiles
3436 cp -f documentation/tutorials/01_Demo_Basic_Run/extfiles/* book_source/extfiles
3537 # compile PEcAn code
36- - name : build
37- run : make -j1
38+ - name : build needed modules
39+ run : |
40+ R CMD INSTALL base/logger
41+ R CMD INSTALL base/remote
42+ R CMD INSTALL base/utils
3843 # render book
3944 - name : Render Book
4045 run : |
4146 cd book_source
4247 Rscript -e 'options(bookdown.render.file_scope=FALSE); bookdown::render_book("index.Rmd", "bookdown::gitbook")'
4348 # save artifact
44- - uses : actions/upload-artifact@v2
49+ - uses : actions/upload-artifact@v3
4550 with :
4651 name : pecan-documentation
4752 path : book_source/_book/
4853 # download documentation repo
4954 - name : Checkout documentation repo
50- if : github.event_name != 'pull_request '
51- uses : actions/checkout@v2
55+ if : github.event_name == 'push '
56+ uses : actions/checkout@v4
5257 with :
5358 repository : ${{ github.repository_owner }}/pecan-documentation
5459 path : pecan-documentation
5560 token : ${{ secrets.GH_PAT }}
5661 # upload new documentation
5762 - name : publish to github
58- if : github.event_name != 'pull_request '
63+ if : github.event_name == 'push '
5964 run : |
6065 git config --global user.email "pecanproj@gmail.com"
6166 git config --global user.name "GitHub Documentation Robot"
62- export VERSION=${ GITHUB_REF##*/}
67+ export VERSION=$(echo $ GITHUB_REF | sed 's,.*/,,' )
6368 cd pecan-documentation
6469 mkdir -p $VERSION
6570 rsync -a --delete ../book_source/_book/ ${VERSION}/
0 commit comments