minor updates #34
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
branches: main | |
name: publish | |
jobs: | |
publish: | |
runs-on: macOS-latest | |
env: | |
GITHUB_PAT: ${{ secrets.GITHUBPAT }} | |
TORCH_INSTALL: 1 | |
R_REMOTES_NO_ERRORS_FROM_WARNINGS: false | |
steps: | |
- name: Checkout repo | |
uses: actions/[email protected] | |
- name: Setup R | |
uses: r-lib/actions/setup-r@v2 | |
- name: Install system requirements | |
run: | | |
brew install pandoc | |
- name: Query dependencies | |
run: | | |
install.packages('remotes') | |
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2) | |
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version") | |
shell: Rscript {0} | |
- name: Cache R packages | |
uses: actions/[email protected] | |
with: | |
path: ${{ env.R_LIBS_USER }} | |
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-2-${{ hashFiles('.github/depends.Rds') }} | |
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-2- | |
- name: Install dependencies | |
run: | | |
install.packages(c("remotes")) | |
remotes::install_deps(dependencies = TRUE) | |
remotes::install_cran("covr") | |
shell: Rscript {0} | |
- name: Cache bookdown results | |
uses: actions/[email protected] | |
with: | |
path: _bookdown_files | |
key: bookdown-${{ hashFiles('**/*Rmd') }} | |
restore-keys: bookdown- | |
- name: Build manual | |
run: | | |
bookdown::render_book(input = "index.Rmd", output_format = "bookdown::gitbook") | |
shell: Rscript {0} | |
- name: Publish manual | |
run: | | |
./inst/publish.sh |